~/talk

Here be dragons: some elegant and ugly hacks in CPython

Talkat PyCon Australia 2014 · 2014-08-01..08-05· [python]
links:none on file
slides:none on file

CPython history shows concrete hacks: a SyntaxError constructor inspects the parser text and emits a specific message for Python 2 style print missing parentheses (landed around 3.4.2) after an experimental implicit calls patch proved the idea; functools.wraps originally copies dunder attributes in a brute‑force loop that works well enough for seven years until a proper proxy appears; collections.namedtuple builds classes by executing a string templating class definition; small REPL affordances come from the site module. These fixes are pragmatic, documented, and mostly effective.

AI-written summary · about

  1. 0:00Intro
  2. 0:28Why isn't all code beautiful?
  3. 4:14Customising Syntax Errors (Demo)
  4. 10:15Buying time with "80% solutions"
  5. 14:20Decorators and wrapper functions (Demo)
  6. 17:11Let me out! (Demo)
  7. 19:46Use simple components
  8. 21:19Implementing a type factory (Demo)
  9. 26:27Keep technical debt under control!
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.