Python: Deterministic Pyc Files and Threading Hardening
Marshal and compiler fixes make pyc output reproducible across processes and builds. Free-threading crash fixes and a lazy multiprocessing default improve stability and startup performance.
Duration: PT2M19S
Episode overview
This episode is a short developer briefing from Python.
It explains recent repository work in plain language.
- Show: Python
- Published: 2026-10-13T13:12:08Z
- Audio duration: PT2M19S
Transcript excerpt
This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.
Hello, it's Tuesday, October 13th, 2026.
Our lead story: Python's compiled output is becoming deterministic. Two linked changes fix why the same source could produce different marshalled bytes and different dot-pyc files.
First theme is reproducible builds. In PR 159192, the marshal writer no longer uses reference counts to decide whether an object gets a back-reference flag. That count depended on what else in the process held a reference, and on thread ownership in the free-threaded build. The writer now flags exactly the objects…
Second theme is free-threading and low-memory reliability. PR 159245 fixes a crash in dict construction from a concurrently mutated key-value pair by reading size and items under a critical section. PR 159269 avoids a stop-the-world pause when setting function name, qualified name, doc, or module attributes, using a…
Third is multiprocessing startup. A recent change checked for a writable temp directory at import time to pick between fork server and spawn, which slowed every import. PR 159254 makes that check lazy, only on first use of a process context.
What's next: watch the open backport to 3.15 for the marshal fix, and validate reproducible builds and…
Nearby episodes from Python
- Reproducible Marshal Output and Runtime Speedups
- Weekly Recap - Thread Safety, GC Efficiency and Platform Polish
- Garbage Collector Speedups and Thread-Safety Fixes
- IDLE Reliability Push and WASM Trampoline
- Crash Hardening and Release Readiness
- Runtime Hardening and Faster I/O
- Free-Threading Safety and C API Hardening
- 3.15 Freeze Revert and Profiler Hardening