diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-01-24 11:09:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 11:09:20 (GMT) |
commit | 58f3d980989c7346ad792d464c1d749dcec6af63 (patch) | |
tree | 42ce19f131f418d9423c3eb26c2a7b91f4c223f2 /Doc/library/dis.rst | |
parent | 0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69 (diff) | |
download | cpython-58f3d980989c7346ad792d464c1d749dcec6af63.zip cpython-58f3d980989c7346ad792d464c1d749dcec6af63.tar.gz cpython-58f3d980989c7346ad792d464c1d749dcec6af63.tar.bz2 |
bpo-46422: use `dis.Positions` in `dis.Instruction` (GH-30716)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r-- | Doc/library/dis.rst | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index ddba668..793152d 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -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. |