mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-46422: use dis.Positions
in dis.Instruction
(GH-30716)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
This commit is contained in:
parent
0367a36fdc
commit
58f3d98098
4 changed files with 42 additions and 14 deletions
|
@ -316,8 +316,30 @@ details of bytecode instructions as :class:`Instruction` instances:
|
|||
|
||||
``True`` if other code jumps to here, otherwise ``False``
|
||||
|
||||
|
||||
.. data:: positions
|
||||
|
||||
:class:`dis.Positions` object holding the
|
||||
start and end locations that are covered by this instruction.
|
||||
|
||||
.. versionadded:: 3.4
|
||||
|
||||
.. versionchanged:: 3.11
|
||||
|
||||
Field ``positions`` is added.
|
||||
|
||||
|
||||
.. class:: Positions
|
||||
|
||||
In case the information is not available, some fields might be `None`.
|
||||
|
||||
.. data:: lineno
|
||||
.. data:: end_lineno
|
||||
.. data:: col_offset
|
||||
.. data:: end_col_offset
|
||||
|
||||
.. versionadded:: 3.11
|
||||
|
||||
|
||||
The Python compiler currently generates the following bytecode instructions.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue