diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-09-07 11:18:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-07 11:18:54 (GMT) |
commit | fa2c0b85a8d5c9486661083afdf38cbaadb3432a (patch) | |
tree | 1b14c61d07dcdfd3e273807f34cc1cac49f858f6 /Doc/reference | |
parent | 2c3474a637949aa6f2f7e15f9764c2dfc49cdba1 (diff) | |
download | cpython-fa2c0b85a8d5c9486661083afdf38cbaadb3432a.zip cpython-fa2c0b85a8d5c9486661083afdf38cbaadb3432a.tar.gz cpython-fa2c0b85a8d5c9486661083afdf38cbaadb3432a.tar.bz2 |
bpo-44964: Add a note explaining the new semantics of f_last_i in frame objects (GH-28200)
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/datamodel.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 2c76e56..46d9c3a 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1069,8 +1069,9 @@ 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 (this is an index into the - bytecode string of the code object). + :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). Accessing ``f_code`` raises an :ref:`auditing event <auditing>` ``object.__getattr__`` with arguments ``obj`` and ``"f_code"``. |