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
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
【ZEPメタバース校舎操作ガイド】
ainischool
0
100
Enterprise UI, v2
stevekinney
0
220
Geografía y fútbol. Atlanta. la megalópolis del fútbol
juanmartin2026
1
12k
生成AI時代のエンジニア育成について考えてみた
akasan
0
240
[2026前期火5] 論理学(京都大学文学部 前期 第9回)「正規化の停止性——ヒドラゲームによる証明」
yatabe
0
270
解決策を教えても次期リーダーは育たない ─ 器の発達に伴走するために / Partnering with leaders in their vertical development
matsu0228
1
710
批判的応用言語学ワークショップ(2026-08-12 お茶の⽔⼥⼦⼤学)
terasawat
0
190
Leveraging LLMs for student feedback in introductory data science courses
minecr
0
110
新しいJavaを学んで・使っていこう! / osd26do
gishi_yama
0
250
AIの力を100%引き出すために
frievea
0
500
Sekolah Sabat - Triwulan 3 2026 - Pelajaran 12
hiola
0
2.5k
オンラインコミュニティ TRY部 体験マニュアル
ytapples613
0
350
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
30 Presentation Tips
portentint
PRO
1
390
Typedesign – Prime Four
hannesfritz
42
3.2k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Paper Plane
katiecoart
PRO
2
53k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Writing Fast Ruby
sferik
630
63k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Mobile First: as difficult as doing things right
swwweet
225
10k
Are puppies a ranking factor?
jonoalderson
2
3.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
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