On 19.03.2022 17:08, Nick Coghlan wrote:
On Sat, 26 Feb 2022 at 00:02, Victor Stinner firstname.lastname@example.org wrote:
On Fri, Feb 25, 2022 at 2:35 PM Marc-Andre Lemburg email@example.com wrote:
Esp. walking the frame stack is important in Python for e.g. logging local variables in tracebacks or accessing context from the call stack further up.
Do you happen to know whether the current work on optimizations will break this approach by e.g. not always creating frames on the stack ?
IMO if it no longer works in Python 3.11, it is a bug and it should be fixed.
I'm not aware of such regression. It should still work. Well, there are alpha releases of Python, you can already test it :-)
Belated follow-up mostly for the sake of the online mailing list archive: while CPython's frame objects have been split in Python 3.11 into a low level C data struct and lazily created full frame objects, all the Python level frame introspection APIs trigger the lazy creation step.
This provides most of the runtime performance gains of skipping frame object creation (as only the low level C struct is needed for code execution), without any Python level backwards compatibility issues (since the full frame objects are still created when needed).
Thanks for the clarification, Nick.