We talk about Python internals, because we work on Python internals. We joke about stuff, because we’re jokers. Episodes between 60 and 90 minutes in length. We...
In this episode, Pablo's avoiding the topic of garbage collection by talking about his latest PEP, which allows unprecedented interaction with a running Python process. We also resolve the bet about reference counting semantics, mention some notable changes in Python since the last episode, and discuss syntax highlighting in PyREPL and why it's bad, actually.## Timestamps(00:00:00) INTRO(00:02:16) PART 1: PABLO'S LATEST PEP(00:04:34) gdb is IMPOSSIBLE(00:12:49) Make the process run code for you(00:14:14) This already works on PyPy(00:15:13) How does it work?(00:25:38) Why a file?(00:31:15) What if you don't trust Pablo?(00:32:57) sys.remote_exec()(00:36:09) Less obvious use cases(00:46:56) PART 2: BETS(00:55:44) PART 3: PR OF THE WEEK(00:55:50) Łukasz: syntax highlighting in PyREPL(01:10:14) Pablo's PR: allow the parser to activate future imports on the fly(01:20:11) PART 4: WHAT'S GOING ON IN CPYTHON(01:20:22) Free threading(01:23:30) Performance(01:34:41) PEP 765 implemented(01:36:08) concurrent.futures.Executor.map(buffersize=)(01:36:57) io.Reader and io.Writer(01:38:40) Pabluco's linecache fetching interactive source code(01:41:25) ast.unparse() roundtrip with semicolons(01:41:59) OUTRO
--------
1:44:20
Episode 19: Async hacks, unicorns and velociraptors
In this asynchronous episode we're interviewing a fellow core developer Yury Selivanov to talk about asyncio's past and future, composable design, immutability, and databases you'd actually like using. We also broke the 2-hour episode barrier!## Timestamps(00:00:00) INTRO(00:01:33) PART 1: INTERVIEW(00:02:27) What drives you?(00:04:47) How do you choose what to work on?(00:08:10) Hyperfocus(00:09:28) Things from Rust that Python could use(00:14:50) Nothing is sacred when you depend on glibc(00:18:47) TypeScript typing is god-tier(00:22:04) Adding async and await to Python(00:34:11) Adding new keywords to the language(00:41:17) Jumping into a new codebase(00:49:22) Any design regrets?(00:58:46) Contextvars(01:10:40) Is the frozenmap PEP happening?(01:19:21) uvloop(01:23:25) What makes Gel lovable?(01:39:57) PART 2: PR OF THE WEEK(01:47:08) Saturday talks at PyCon should be fun(01:50:35) PART 3: WHAT'S GOING ON IN CPYTHON(01:50:47) Ken Jin's tail-call interpreter(01:55:05) Barney Gale's glob.glob() optimization(01:55:43) Brandt's boolean guards to narrow types to values in the JIT(01:56:33) Mark Shannon's stack limits implemented with addresses, not counters(01:58:34) Brandt's removal of _DYNAMIC_EXIT(01:58:53) Mark Shannon's async for branches instrumented(01:59:36) Free-threading changes(01:59:58) Sam Gross' regression tests can now run in --parallel-threads(02:00:34) Tomasz Pytel's thread safety crusade(02:01:01) Xuanteng Huang's __annotations__ race fix(02:01:11) Kumar's per-thread linked lists for tasks(02:02:54) Serhiy's crashes related to PySys_GetObject() fixed(02:03:22) Sam's usage of stack pointers in thread stack traversal(02:03:38) Dino Viehland's lock avoidance during object cleanup(02:04:23) OUTRO
--------
2:07:21
Episode 18: Reference Counting
After we talked about memory allocation in Python back in Episode 16, we're ready to complain, uh, explain reference counting. Or at least throw a bunch of reference counting facts at you. Plus a big assortment of recent Python changes. You ready?
## Timestamps
(00:00:00) INTRO
(00:04:17) PART 0: SPORTS NEWS
(00:06:53) PART 1: REFERENCE COUNTING
(00:08:28) New segment of 2025
(00:13:54) C++ is asymptotic Python
(00:15:37) Is Rust game yet?
(00:18:01) Names
(00:20:25) Breaking the law
(00:23:08) sys.getrefcount()
(00:25:21) Pedantic Pablo
(00:26:06) sys.gettotalrefcount()
(00:31:24) TraceRefs
(00:33:28) Advantages of refcounting
(00:36:16) Disadvantages of refcounting
(00:38:40) Reference cycles
(00:40:39) Multithreading
(00:41:25) When refcounting goes wrong
(00:44:05) Freeing memory in Python doesn't return it to the OS
(00:45:42) Leaks and cycles redux
(00:50:29) Double free
(00:53:05) Avoiding reference counting
(00:54:59) Immortal objects
(01:00:40) PART 2: WHAT'S GOING ON IN CPYTHON
(01:02:43) New features
(01:04:11) Assorted interesting changes
(01:15:23) Performance
(01:18:09) Free-threading changes galore
(01:27:02) AsyncIO
(01:34:25) Windows changes
(01:36:45) Security
(01:37:20) OUTRO
--------
1:39:07
Episode 17: Argparse, JIT, and balloons with Savannah Ostrowski
Meet our newest member of the core developer team, Savannah! Currently at Snowflake, she also worked with development tools at Docker and Microsoft, but also flew drones over forests. In terms of CPython, Savannah works on argparse and the JIT, but that's not her last word.
# Timestamps
(00:00:00) INTRO
(00:01:26) PART 1: INTERVIEW WITH SAVANNAH OSTROWSKI
(00:02:12) Beginnings as a Python user
(00:04:14) Carol Willing's nudge
(00:06:55) First PR
(00:08:56) Psychological damage from asyncio
(00:11:51) Savannah at ***** Maps
(00:14:04) Chipotle Claim to Fame
(00:16:14) The most funky CPython discoveries
(00:19:06) What if you could break backwards compatibility in argparse?
(00:23:51) How do the JIT internals look to new eyes?
(00:27:33) Is Savannah team typing?
(00:33:55) Somebody's jealous
(00:37:29) Favorite PEP and least favorite PEP
(00:42:10) Big Fish
(00:52:58) Hard conversations
(01:02:31) Polska
(01:06:37) Do it scared
(01:08:14) PART 2: PR OF THE WEEK
(01:08:22) Łukasz
(01:12:01) Pabluco
(01:14:46) Savannah
(01:18:27) PART 3: WHAT'S GOING ON IN CPYTHON
(01:21:21) Features
(01:29:59) Bug fixes
(01:33:42) Performance
(01:40:12) Security
(01:43:23) OUTRO
--------
1:45:06
Episode 16: Memory Allocation
How does Python handle memory? Why does it need to perform custom forms of memory allocation? We talk about all that in this episode. We don't talk about Easter eggs, and we never mention Brandt by name, as promised last time!
## Timestamps
(00:00:00) INTRO
(00:00:22) PART 0: SPORTS NEWS
(00:01:57) PART 1: MEMORY ALLOCATION
(00:03:46) If you write C correctly, it manages memory for you
(00:05:38) malloc and the heap
(00:09:31) High-level allocators
(00:10:48) pymalloc
(00:11:15) 512 is a good number
(00:12:43) Memory domains in pymalloc
(00:15:09) Why is pymalloc faster than just using malloc?
(00:20:16) To free or not to free
(00:26:35) User-facing features of pymalloc
(00:30:40) Łukasz replaced by an LLM Sim... almost
(00:32:58) Debugging help with marked memory
(00:39:24) 8-byte alignment
(00:42:27) cymem
(00:45:08) tracemalloc
(00:49:12) memray
(00:50:47) Coding like an ultravillain
(00:55:22) Complaining about Apple
(01:01:45) PART 2: PR OF THE WEEK
(01:13:46) Pablo's buildbot release status page
(01:18:26) PART 3: WHAT'S GOING ON IN CPYTHON
(01:18:52) PEP 762
(01:22:30) PEP 758
(01:26:10) Performance updates
(01:29:14) Argparse suggests correct spelling
(01:30:13) Fraction.from_number() and Decimal.from_number()
(01:30:39) switched in contextvars
(01:31:42) Better type annotations in pydoc signatures
(01:33:33) Fixes in TaskGroup and _PyFuture ref cycles
(01:34:03) Data race in ZoneInfo
(01:35:53) Testing certificates set to expire far in the future
(01:36:32) InternalDocs
(01:40:22) There are no Easter eggs
(01:40:42) OUTRO
We talk about Python internals, because we work on Python internals. We joke about stuff, because we’re jokers. Episodes between 60 and 90 minutes in length. We’ve done more than a few so far and it doesn’t seem like we’ll be stopping any time soon!
Hi Loren!