◐ Shell
clean mode source ↗

bpo-46355: Document PyFrameObject and PyThreadState changes by vstinner · Pull Request #30558 · python/cpython

Conversation

Document PyFrameObject and PyThreadState changes in What's New in
Python 3.11 and explain how to port code.

@vstinner

vstinner

The Python frame object is now created lazily. A side effect is that the
``f_back`` member must not be accessed directly, since its value is now also
computed lazily. The :c:func:`PyFrame_GetBack` function must be called
instead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created https://bugs.python.org/issue46356 to propose to enforce the usage of PyFrame_GetBack() on Python 3.11 to make the C API less error prone.

@vstinner

Labels