~/talk

How to change Python (while it's running)

Talkat PyCon US 2022 · 2022-04-27..05-03· [python, developer-experience]
slides:none on file

Live development of a running Python process by swapping function code objects is practical and implemented as Jurigged which watches files (watchdog), compiles new code in isolation and hot‑patches by updating function __code__ pointers after locating references via gc and the audit hook from Python 3.8. It updates functions methods and closures most of the time and adds a dunder conform protocol for library-specific state patches. Limits include object layout changes, running frames only seeing changes on next call, line‑number and decorator/JIT incompatibilities.

AI-written summary · about

  1. 0:00Start
  2. 0:55What is live coding?
  3. 1:57Existing platforms
  4. 3:35We want to update functions
  5. 6:01We want to add update methods
  6. 7:21We want to update closures
  7. 11:30How a function is executed
  8. 14:31Patching a function
  9. 14:50Plan
  10. 17:33Find the old code object (bis)
  11. 18:43Find all functions
  12. 19:33Profit?
  13. 20:33What happens ?
  14. 22:41conform_protocol
~/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.