Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Job Security (in Python) (Christopher Neugebauer)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
PyCon Canada
August 25, 2013
Education
570
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Job Security (in Python) (Christopher Neugebauer)
PyCon Canada
August 25, 2013
More Decks by PyCon Canada
See All by PyCon Canada
Sad Panda Needs a Hug (Nina Zakharenko)
pyconca
0
500
Shopify Checkout (Chris Saunders)
pyconca
0
270
Saturday Morning BreakfastSerial: Hacking Arduinos in Python (Swift)
pyconca
2
190
Skyfield and 15 Years of Bad APIs (Brandon Rhodes)
pyconca
0
470
Planting Open Source Seeds (Kenneth Reitz)
pyconca
0
180
Why Open Source Works (Alex Gaynor)
pyconca
0
260
How to learn Python in 5 Minutes (Daniel Moniz)
pyconca
0
1.1k
Sunday Morning Keynote (Karen Brennan)
pyconca
0
360
Saturday Morning Keynote (Jacob Kaplan-Moss)
pyconca
2
140
Other Decks in Education
See All in Education
新しいJavaを学んで・使っていこう! / osd26do
gishi_yama
0
260
学習者データを「見る」:外国語教師のためのデータの入力、分析、解釈方法
uranoken
0
330
NDIAS Automotive / IoT CTF 2026 Recap - Keyfob & OSINT
himitu23
0
340
子どものためのプログラミング道場『CoderDojo』〜法人提携例〜 / Partnership with CoderDojo Japan
coderdojojapan
PRO
4
19k
Soluciones al examen de Geografía 2026. JULIO (Convocatoria Extraordinaria)
juanmartin2026
1
19k
Visionary Initiative: Materials-Positive Society 「モノの進化をポジティブな社会の原動力に」|Science Tokyo(東京科学大学)
sciencetokyo
PRO
0
1.4k
AIがコードを書く時代に、何を教えるのか / What Should We Teach in the Age of AI-Generated Code?
ichiroc
1
560
Sanapilvet opetuksessa
matleenalaakso
1
36k
CLASSIFICATION OF CRUDE DRUGS
pawan_pharm
0
190
解決策を教えても次期リーダーは育たない ─ 器の発達に伴走するために / Partnering with leaders in their vertical development
matsu0228
1
720
マークシート試験のTeX言語を用いた自動採点について
doratex
0
3.5k
「答えを出す」より「わかる」をつくる
kzkmaeda
1
300
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Un-Boring Meetings
codingconduct
0
420
BBQ
matthewcrist
89
10k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
910
Unsuck your backbone
ammeep
672
58k
Are puppies a ranking factor?
jonoalderson
2
3.9k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
230
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Transcript
Hello Canadia!
Job Security (in Python) Christopher Neugebauer @chrisjrn http://chris.neugebauer.id.au
Hello!
Why do people code Python?
“Readability” -- Raymond Hettinger, PyCon US 2013
“Readability Counts” -- Tim Peters, “The Zen of Python” (import
this)
PEP 0008 “Style Guide for Python Code”
None
Readability Sucks.
1. People can comprehend your code.
2. You can maintain your own code.
3. Your code will be more readily reusable.
THIS IS ALL BAD.
How do I write unmaintainable code?
1) Obvious variable names
1) Obvious (to you) variable names
• Callables: Superheroes • Classes: Musical characters • Strings: Famous
actors • Numbers: Movie characters
MerryPoppins.captain_america(matt_damon, james_bond)
Spiderman.spiderman(spiderman)
2) Metaprogramming
class Collection(Magic): def get_spam(self): return self.spam def set_spam(self, default): self.spam
= default
>>> c = Collection() >>> c.set_spam(“eggs”)
>>> c = Collection() >>> c.set_spam(“eggs”) Traceback (most recent call
last): File "<stdin>", line 1, in <module> File "<stdin>", line 10, in __getattribute__ TypeError: instancemethod expected at least 2 arguments, got 0
Help on Collection in module __main__ object: class Collection(Magic) |
Method resolution order: | Collection | Magic | __builtin__.object | | Methods defined here: | | get_spam(self) | | set_spam(self, default)
TRANSLATE = (("get","_bork_"), ("set","_bork_"), ("canhas" , "get"), ("ihasa" , "set"))
class Magic(object): def __getattribute__(self, attribute): oa = attribute for (key,val) in TRANSLATE: attribute = attribute.replace(key, val) try: return object. __getattribute__(self,attribute) except AttributeError: return type(object. __getattribute__(self, oa))
c.ihasa_spam("foo") -> c.set_spam(“foo”) c.canhas_spam() -> c.get_spam()
3) Monkey patching
“A batteries-included standard library” -- Raymond Hettinger, PyCon US 2013
Roll your own standard library
>>> import math >>> math.cos(0)
>>> import math >>> math.cos(0) 0.0
>>> import magic >>> import math >>> math.cos(0) 0.0
import math math.cos, math.sin = math.sin, math.cos
- End -
This talk was a joke.
Don’t do this.
The end. Christopher Neugebauer @chrisjrn http://chris.neugebauer.id.au