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
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
520
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
組合せ最適化特論
tasusu
0
130
Sekolah Sabat - Triwulan 4 2026 - Pelajaran 2
hiola
0
9.9k
GENERAL PHARMACOLOGY
pawan_pharm
0
180
医療事務養成の専門学校でのAI教育 非エンジニアの学生にAIを1年間使ってもらって、感じたこと
naochim2026
0
140
オンラインコミュニティ TRY部 体験マニュアル
ytapples613
0
370
学習者データを「見る」:外国語教師のためのデータの入力、分析、解釈方法
uranoken
0
410
20260908_ターゲットとスコープを決める発表法
masakiokuda
1
130
Sekolah Sabat - Triwulan 3 2026 - Pelajaran 12
hiola
0
12k
An Experiment in "Cross-Cultural Exchange" as a Method for Content Creation
naoji_taniguchi_ksk_0827
0
240
El Geoparque Mundial UNESCO Volcanes de Calatrava de la Investigación Científica a la Transposición Didáctica en el aula
juanmartin2026
0
6.4k
日本における応用言語学・言語教育学これまでとこれから
terasawat
0
130
Comentario del plano urbano de Madrid hasta 1860 (1ª parte )
juanmartin2026
1
100k
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Abbi's Birthday
coloredviolet
4
10k
Designing Experiences People Love
moore
143
24k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
910
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
400
Crafting Experiences
bethany
1
380
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
350
The Curious Case for Waylosing
cassininazir
1
560
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
490
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