diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 46d9c3a95473cf..2c76e5656b0e63 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -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 ` ``object.__getattr__`` with arguments ``obj`` and ``"f_code"``. diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 8b0d38b598706d..612fae49a2898a 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -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 ========================