Indent 2.4.1-exp — proving that nothing broke
This build is aimed at the exp channel rather than stable. It finishes the low-risk half of the memory work — and, more usefully, makes "nothing broke" something the project can check instead of hope.
Every released behaviour is now pinned
Real programs are captured as the exact text they print: how values format, control flow, functions, errors and classes, the copy-on-write guarantees, and a torture program covering nested functions, generators, inheritance, mutation through aliases, dict ordering, unicode and error messages word for word. Each one is run through both execution engines three times and has to match byte for byte, so the faster path can never quietly disagree with the safe one.
The release check always claimed to compare against recorded performance, but nothing had ever been recorded. 158 measurements are recorded now, with a 15% tolerance — so a slowdown gets caught instead of being noticed months later.
Worth knowing, because none of it was written down
say trueprintsTRUE.- Strings inside containers print unquoted.
- Dict keys print in sorted order.
len("héllo 🚀")counts codepoints, not bytes.
What it means for your code
- Nothing changes. There is no new syntax and no changed behaviour, and there is nothing to do to upgrade.
- Startup does a couple of dozen fewer allocations, because a table that used to be rebuilt for every run is now built once.
- A tempting micro-optimisation was measured and rejected. Holding the output stream open for a whole run would have saved a fraction of the ~90 ns a
saycosts, but in a server it would let one request that prints block every other thread's output.