Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Job Security (in Python) (Christopher Neugebauer)
Search
PyCon Canada
August 25, 2013
Education
560
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
면접관 눈에 띄는 데이터 분석 포트폴리오 만드는 법 | 2026년 5월 세미나
datarian
0
1.1k
0526
cbtlibrary
0
270
Gitがない時代 インターネットがない時代の 開発話
sapi_kawahara
0
390
2026年度春学期 統計学 第13回 不確かな測定の不確かさを測る ― 不偏分散とt分布 (2026. 6. 25)
akiraasano
PRO
1
180
Throw Yourself In! - How I've learned English and What I'm Facing
georgeorge
1
260
チームの鏡になるー自分の癖を知ると、チームのパターンが見えてくる@スクフェス仙台
saorimurooka
0
170
形骸化しない社内勉強会の取り組み - オーナーシップの作り方 / In-house study session
soudai
PRO
1
260
Comentario del plano urbano de Madrid hasta 1860 (1ª parte )
juanmartin2026
1
56k
Examen de Selectividad. Geografía julio 2026 (Convocatoria Extraordinaria). UCLM
juanmartin2026
1
13k
Science Tokyo University for International Research Excellence scheme_April 2026
sciencetokyo
PRO
0
120
[2026前期火5] 論理学(京都大学文学部 前期 第8回)「正規化定理の証明」
yatabe
0
320
AI-Based Speaking Assessment of a Short-Term Study Abroad Program
uranoken
0
480
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
370
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Skip the Path - Find Your Career Trail
mkilby
1
220
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Designing for humans not robots
tammielis
254
26k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
470
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