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
510
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
190
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
370
Saturday Morning Keynote (Jacob Kaplan-Moss)
pyconca
2
150
Other Decks in Education
See All in Education
Introduction to M&A
bvr7352
0
230
NDIAS Automotive / IoT CTF 2026 Recap - Keyfob & OSINT
himitu23
0
350
新しいJavaを学んで・使っていこう! / osd26do
gishi_yama
0
260
検定資格の価値 ~実はすごいよQC検定~
bunnchinn3
0
240
Sekolah Sabat - Triwulan 4 2026 - Pelajaran 1
hiola
0
12k
Quality Control of Crude Drugs
pawan_pharm
0
180
Sanapilvet opetuksessa
matleenalaakso
1
36k
Sekolah Sabat - Triwulan 3 2026 - Pelajaran 13
hiola
0
10k
遊ぶかね欲しさの犯行(ルビ:労働)です
shirayanagiryuji
0
290
私たちはなんでテストするんだっけ? Ver.東北IT物産展2026 in 会津若松
camel_404
3
210
Railsチュートリアル × 反転学習の事例紹介
yasslab
PRO
3
190k
LEGO Geometry Tutorial
arnoknobbe
0
620
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
260
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Paper Plane
katiecoart
PRO
4
53k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Done Done
chrislema
187
17k
Agile that works and the tools we love
rasmusluckow
331
22k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Evolving SEO for Evolving Search Engines
ryanjones
0
300
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