@@ -43,13 +43,13 @@ interpreter.
4343 adaptive bytecode can be shown by passing ``adaptive=True ``.
4444
4545
46- Example: Given the function :func: `myfunc `::
46+ Example: Given the function :func: `! myfunc `::
4747
4848 def myfunc(alist):
4949 return len(alist)
5050
5151the following command can be used to display the disassembly of
52- :func: `myfunc `:
52+ :func: `! myfunc `:
5353
5454.. doctest ::
5555
@@ -297,6 +297,9 @@ operation is being performed, so the intermediate analysis object isn't useful:
297297 The :pep: `626 ` ``co_lines `` method is used instead of the ``co_firstlineno ``
298298 and ``co_lnotab `` attributes of the code object.
299299
300+ .. versionchanged :: 3.13
301+ Line numbers can be ``None `` for bytecode that does not map to source lines.
302+
300303
301304.. function :: findlabels(code)
302305
@@ -402,7 +405,12 @@ details of bytecode instructions as :class:`Instruction` instances:
402405
403406 .. data :: starts_line
404407
405- line started by this opcode (if any), otherwise ``None ``
408+ ``True `` if this opcode starts a source line, otherwise ``False ``
409+
410+
411+ .. data :: line_number
412+
413+ source line number associated with this opcode (if any), otherwise ``None ``
406414
407415
408416 .. data :: is_jump_target
@@ -429,8 +437,11 @@ details of bytecode instructions as :class:`Instruction` instances:
429437
430438 .. versionchanged :: 3.13
431439
440+ Changed field ``starts_line ``.
441+
432442 Added fields ``start_offset ``, ``cache_offset ``, ``end_offset ``,
433- ``baseopname ``, ``baseopcode ``, ``jump_target `` and ``oparg ``.
443+ ``baseopname ``, ``baseopcode ``, ``jump_target ``, ``oparg ``, and
444+ ``line_number ``.
434445
435446
436447.. class :: Positions
@@ -851,7 +862,7 @@ iterations of the loop.
851862
852863.. opcode :: LOAD_BUILD_CLASS
853864
854- Pushes :func: `builtins.__build_class__ ` onto the stack. It is later called
865+ Pushes :func: `! builtins.__build_class__ ` onto the stack. It is later called
855866 to construct a class.
856867
857868
@@ -909,14 +920,14 @@ iterations of the loop.
909920.. opcode :: STORE_NAME (namei)
910921
911922 Implements ``name = STACK.pop() ``. *namei * is the index of *name * in the attribute
912- :attr: `co_names ` of the code object. The compiler tries to use
913- :opcode: `STORE_FAST ` or :opcode: `STORE_GLOBAL ` if possible.
923+ :attr: `! co_names ` of the :ref: ` code object < code-objects >`.
924+ The compiler tries to use :opcode: `STORE_FAST ` or :opcode: `STORE_GLOBAL ` if possible.
914925
915926
916927.. opcode :: DELETE_NAME (namei)
917928
918- Implements ``del name ``, where *namei * is the index into :attr: `co_names `
919- attribute of the code object.
929+ Implements ``del name ``, where *namei * is the index into :attr: `! co_names `
930+ attribute of the :ref: ` code object < code-objects >` .
920931
921932
922933.. opcode :: UNPACK_SEQUENCE (count)
@@ -955,7 +966,8 @@ iterations of the loop.
955966 value = STACK.pop()
956967 obj.name = value
957968
958- where *namei * is the index of name in :attr: `co_names `.
969+ where *namei * is the index of name in :attr: `!co_names ` of the
970+ :ref: `code object <code-objects >`.
959971
960972.. opcode :: DELETE_ATTR (namei)
961973
@@ -964,7 +976,8 @@ iterations of the loop.
964976 obj = STACK.pop()
965977 del obj.name
966978
967- where *namei * is the index of name into :attr: `co_names `.
979+ where *namei * is the index of name into :attr: `!co_names ` of the
980+ :ref: `code object <code-objects >`.
968981
969982
970983.. opcode :: STORE_GLOBAL (namei)
0 commit comments