Skip to content

Commit f8dd290

Browse files
[3.11] Docs: Amend codeobject.co_lines docs; end number is exclusive (GH-113970) (#113988)
The end number should be exclusive, not inclusive. (cherry picked from commit e68806c) Co-authored-by: Ned Batchelder <[email protected]>
1 parent 64d8f39 commit f8dd290

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/reference/datamodel.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,20 +1246,20 @@ Methods on code objects
12461246

12471247
* ``start`` (an :class:`int`) represents the offset (inclusive) of the start
12481248
of the :term:`bytecode` range
1249-
* ``end`` (an :class:`int`) represents the offset (inclusive) of the end of
1249+
* ``end`` (an :class:`int`) represents the offset (exclusive) of the end of
12501250
the :term:`bytecode` range
12511251
* ``lineno`` is an :class:`int` representing the line number of the
12521252
:term:`bytecode` range, or ``None`` if the bytecodes in the given range
12531253
have no line number
12541254

1255-
The items yielded generated will have the following properties:
1255+
The items yielded will have the following properties:
12561256

12571257
* The first range yielded will have a ``start`` of 0.
12581258
* The ``(start, end)`` ranges will be non-decreasing and consecutive. That
12591259
is, for any pair of :class:`tuple`\s, the ``start`` of the second will be
12601260
equal to the ``end`` of the first.
12611261
* No range will be backwards: ``end >= start`` for all triples.
1262-
* The :class:`tuple` yielded will have ``end`` equal to the size of the
1262+
* The last :class:`tuple` yielded will have ``end`` equal to the size of the
12631263
:term:`bytecode`.
12641264

12651265
Zero-width ranges, where ``start == end``, are allowed. Zero-width ranges

0 commit comments

Comments
 (0)