@@ -759,12 +759,19 @@ Porting to Python 3.11
759759 which are not available in the limited C API.
760760 (Contributed by Victor Stinner in :issue: `46007 `.)
761761
762- * Changes of the :c:type: `PyFrameObject ` structure members:
762+ * Changes of the private :c:type: `PyFrameObject ` structure members.
763+
764+ While the documentation notes that the fields of ``PyFrameObject `` are
765+ subject to change at any time, they have been stable for a long time
766+ and were used in several popular extensions.
767+ In Python 3.11, the frame struct was reorganized to allow performance
768+ optimizations. Rather than reading the fields directly, extensions should
769+ use functions:
763770
764771 * ``f_code ``: removed, use :c:func: `PyFrame_GetCode ` instead.
765772 Warning: the function returns a :term: `strong reference `, need to call
766773 :c:func: `Py_DECREF `.
767- * ``f_back ``: changed, use :c:func: `PyFrame_GetBack `.
774+ * ``f_back ``: changed (see below) , use :c:func: `PyFrame_GetBack `.
768775 * ``f_builtins ``: removed,
769776 use ``PyObject_GetAttrString(frame, "f_builtins") ``.
770777 * ``f_globals ``: removed,
@@ -773,13 +780,17 @@ Porting to Python 3.11
773780 use ``PyObject_GetAttrString(frame, "f_locals") ``.
774781 * ``f_lasti ``: removed,
775782 use ``PyObject_GetAttrString(frame, "f_lasti") ``.
776- * ``f_valuesstack ``: removed.
777- * ``f_stackdepth ``: removed.
778- * ``f_gen ``: removed.
779- * ``f_iblock ``: removed.
780- * ``f_state ``: removed.
781- * ``f_blockstack ``: removed.
782- * ``f_localsplus ``: removed.
783+
784+ The following fields were removed entirely, as they were details
785+ of the old implementation:
786+
787+ * ``f_valuesstack ``
788+ * ``f_stackdepth ``
789+ * ``f_gen ``
790+ * ``f_iblock ``
791+ * ``f_state ``
792+ * ``f_blockstack ``
793+ * ``f_localsplus ``
783794
784795 The Python frame object is now created lazily. A side effect is that the
785796 ``f_back `` member must not be accessed directly, since its value is now also
0 commit comments