~/talk

Playing with CPython Objects Internals

Talkat EuroPython 2015 · 2015-07-20..07-26· [python]
slides:none on file

Uses ctypes and the C API to poke at CPython object fields like ob_refcnt, ob_type, ob_size and ob_digit, freeing None and truncating tuples and lists, sharing list buffers and turning two lists into aliases. Demonstrates small-int cache from -5 to 256 so mutating a cached 100 makes every 100 become 101, flips True/False, and replaces integer add slot to always return 42. Examples run but corrupt interpreter state and are unsafe for production.

AI-written summary · about

  1. 0:00Start
  2. 0:54Object
  3. 1:53Basic structure
  4. 5:20int structure
  5. 5:51int examples
  6. 6:27Accessing int
  7. 9:01bool structure
  8. 9:31Accessing bool
  9. 10:54bytes structure
  10. 11:30bytes examples
  11. 11:52Accessing bytes
  12. 12:23tuple structure
  13. 12:41tuple example
  14. 13:00Accessing tuple
  15. 13:52list structure
  16. 14:24list example
  17. 15:11Accessing list
  18. 15:42Very bad things
  19. 16:40dict structure
  20. 17:58dict keys structure
  21. 18:35dict key entry structure
  22. 18:45dict example (combined tables)
  23. 20:02dict example (splitted tables)
  24. 21:18Accessing dict
  25. 24:03References
  26. 25:18Conclusions
~/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.