Skip to content

Commit 8a716bc

Browse files
authored
bpo-40421: What's New in Python 3.11: PyFrameObject.f_lasti (GH-31536)
Suggest replacing PyCode_Addr2Line() with PyFrame_GetLineNumber().
1 parent 281ea9c commit 8a716bc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,8 @@ Porting to Python 3.11
853853
use ``PyObject_GetAttrString((PyObject*)frame, "f_locals")``.
854854
* ``f_lasti``: removed,
855855
use ``PyObject_GetAttrString((PyObject*)frame, "f_lasti")``.
856+
Code using ``f_lasti`` with ``PyCode_Addr2Line()`` should use
857+
:c:func:`PyFrame_GetLineNumber` instead.
856858

857859
The following fields were removed entirely, as they were details
858860
of the old implementation:

0 commit comments

Comments
 (0)