[Python-checkins] bpo-40421: What's New in Python 3.11: PyFrameObject.f_lasti (GH-31536)

vstinner webhook-mailer at python.org
Wed Feb 23 14:20:08 EST 2022


https://github.com/python/cpython/commit/8a716bc62c8205bb9deeda17422b7e69204b6897
commit: 8a716bc62c8205bb9deeda17422b7e69204b6897
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2022-02-23T20:20:03+01:00
summary:

bpo-40421: What's New in Python 3.11: PyFrameObject.f_lasti (GH-31536)

Suggest replacing PyCode_Addr2Line() with PyFrame_GetLineNumber().

files:
M Doc/whatsnew/3.11.rst

diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 34642e320dd18..9744051ede6bb 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -853,6 +853,8 @@ Porting to Python 3.11
     use ``PyObject_GetAttrString((PyObject*)frame, "f_locals")``.
   * ``f_lasti``: removed,
     use ``PyObject_GetAttrString((PyObject*)frame, "f_lasti")``.
+    Code using ``f_lasti`` with ``PyCode_Addr2Line()`` should use
+    :c:func:`PyFrame_GetLineNumber` instead.
 
   The following fields were removed entirely, as they were details
   of the old implementation:



More information about the Python-checkins mailing list