~/talk

5 Years of Bad Ideas

Talkat EuroPython 2011 · 2011-06-20..06-26· [python]
slides:none on file

Five years of practical Python magic: concrete techniques include using sys._getframe to inspect callers, metaclasses and bytecode rewriting to inject an implicit self, AST transforms and import hooks to rewrite code, and an implemented GitHub importer that loads modules directly (500 HTTP requests, very slow). A working multiversion proof‑of‑concept renames modules in sys.modules and serves per-caller versions; it mostly works but relies on fragile internals, ctypes trace patching for readable template tracebacks can crash on some builds, and live reloading requires global locking and careful design.

AI-written summary · about

  1. 0:00Intro
  2. 0:36General Idea
  3. 1:38What is Magic
  4. 5:40What is Classes
  5. 6:14Xik
  6. 7:36AC
  7. 9:44Import hooks
  8. 10:58Monkey patching
  9. 11:13Under on a building
  10. 12:48System Modules
  11. 14:55Overloading
  12. 16:03Monkey Patch
  13. 17:54Internal Warfare
  14. 18:12Local Functions
  15. 21:18Frame
  16. 22:26implicit self
  17. 24:08return value use
  18. 25:38names
  19. 30:10ABCDE
  20. 31:18Bad Ideas
~/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.