PEP 626 - slight word and grammar changes (#1532)
This commit is contained in:
parent
97354461ac
commit
9ff31b067f
10
pep-0626.rst
10
pep-0626.rst
|
@ -44,7 +44,7 @@ Rather than attempt to fix the ``co_lnotab`` attribute, a new method
|
|||
``co_lines()`` will be added, which returns an iterator over bytecode offsets and source code lines.
|
||||
|
||||
Ensuring that the bytecode is annotated correctly to enable accurate line number information means that
|
||||
some bytecodes must be marked as artificial, and not having a line number.
|
||||
some bytecodes must be marked as artificial, and not have a line number.
|
||||
|
||||
Some care must be taken not to break existing tooling.
|
||||
To minimize breakage, the ``co_lnotab`` attribute will be retained, but lazily generated on demand.
|
||||
|
@ -72,14 +72,14 @@ The f_lineno attribute
|
|||
''''''''''''''''''''''
|
||||
|
||||
* When a frame object is created, the ``f_lineno`` will be set to the line
|
||||
at which the function, or class is defined. For modules it will be set to zero.
|
||||
at which the function or class is defined. For modules it will be set to zero.
|
||||
* The ``f_lineno`` attribute will be updated to match the line number about to be executed,
|
||||
even if tracing is turned off and no event is generated.
|
||||
|
||||
The new co_lines() method of code objects
|
||||
'''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
The ``co_lines()`` method will return an iterator which yields tupled of values,
|
||||
The ``co_lines()`` method will return an iterator which yields tuples of values,
|
||||
each representing the line number of a range of bytecodes. Each tuple will consist of three values:
|
||||
|
||||
* ``start`` -- The offset (inclusive) of the start of the bytecode range
|
||||
|
@ -122,8 +122,8 @@ Any tools that parse the ``co_lnotab`` attribute of code objects will need to mo
|
|||
Tools that use ``sys.settrace`` will be unaffected, except in cases where the "line" events they receive are more accurate.
|
||||
|
||||
|
||||
Examples of code for which the sequence of trace events which will change
|
||||
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
Examples of code for which the sequence of trace events will change
|
||||
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
In the following examples, events are listed as "name", ``f_lineno`` pairs.
|
||||
|
||||
|
|
Loading…
Reference in New Issue