On 19.03.2022 17:08, Nick Coghlan wrote:
On Sat, 26 Feb 2022 at 00:02, Victor Stinner <vstinner@python.org> wrote:
On Fri, Feb 25, 2022 at 2:35 PM Marc-Andre Lemburg <mal@egenix.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.
-- Marc-Andre Lemburg eGenix.com
Professional Python Services directly from the Experts (#1, Mar 21 2022)
Python Projects, Coaching and Support ... https://www.egenix.com/ Python Product Development ... https://consulting.egenix.com/
::: We implement business ideas - efficiently in both time and costs :::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 https://www.egenix.com/company/contact/ https://www.malemburg.com/