]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44964: Correct the note about the f_lasti field (GH-28208)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Fri, 10 Sep 2021 15:53:42 +0000 (16:53 +0100)
committerGitHub <noreply@github.com>
Fri, 10 Sep 2021 15:53:42 +0000 (17:53 +0200)
Doc/reference/datamodel.rst
Doc/whatsnew/3.10.rst

index bf3f5082fd5e0e800e0e749eeafced35bdcb9afb..fd78c7ef3c86fa34808e0c694ba9857f9deba16f 100644 (file)
@@ -1069,9 +1069,8 @@ Internal types
       :attr:`f_code` is the code object being executed in this frame; :attr:`f_locals`
       is the dictionary used to look up local variables; :attr:`f_globals` is used for
       global variables; :attr:`f_builtins` is used for built-in (intrinsic) names;
-      :attr:`f_lasti` gives the precise instruction (it represents a wordcode index, which
-      means that to get an index into the bytecode string of the code object it needs to be
-      multiplied by 2).
+      :attr:`f_lasti` gives the precise instruction (this is an index into the
+      bytecode string of the code object).
 
       Accessing ``f_code`` raises an :ref:`auditing event <auditing>`
       ``object.__getattr__`` with arguments ``obj`` and ``"f_code"``.
index ad005dc2ed674037f1cc77517d6617a044103fa8..e5069c5d9aeaf22ccb2b8744158b72c58446056b 100644 (file)
@@ -1952,7 +1952,8 @@ Changes in the C API
     offset instead of a simple offset into the bytecode string. This means that this
     number needs to be multiplied by 2 to be used with APIs that expect a byte offset
     instead (like :c:func:`PyCode_Addr2Line` for example). Notice as well that the
-    ``f_lasti`` member of ``FrameObject`` objects is not considered stable.
+    ``f_lasti`` member of ``FrameObject`` objects is not considered stable: please
+    use :c:func:`PyFrame_GetLineNumber` instead.
 
 CPython bytecode changes
 ========================