~/talk

Let's make a working implementation of async functions in Python 2.1, also, why you might want to us

Talkat PyCon AU 2024 · 2024-11-22..11-26· [python]
slides:none on file

A working async implementation for ancient Python is actually constructed: a custom yield from backfill implements delegation, a minimal channels via yield expressions restores bidirectional send/throw, and a tiny bytecode hack using sys.settrace plus code object patching suspends and resumes execution. The demo runs on Python 1.6 (claimed compatible with 2.1 era), leaves locals on self only, uses marshal to recreate code objects, and proves it works but also shows why modern async/await and VM opcodes are far safer and clearer.

AI-written summary · about

  1. 0:00Introduction
  2. 1:51Modern Python overwhelming
  3. 2:58Async functions importance
  4. 4:22Python 1.6 limits Twisted
  5. 5:24Modern async await syntax
  6. 6:28Yield from generator delegation
  7. 8:13Reimplementing generator delegation
  8. 10:01Bidirectional channels
  9. 12:06Suspendable functions Python 1.6
  10. 16:48Tracing execution sys.setrace
  11. 19:41Demo async Python 1.6
  12. 20:48Why newer Python preferable
  13. 23:39Evolution async Python
  14. 26:05Modern Python benefits
  15. 26:47Q&A
~/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.