]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Docs: Amend codeobject.co_lines docs; end number is exclusive (#113970)
authorNed Batchelder <ned@nedbatchelder.com>
Fri, 12 Jan 2024 15:04:14 +0000 (10:04 -0500)
committerGitHub <noreply@github.com>
Fri, 12 Jan 2024 15:04:14 +0000 (16:04 +0100)
The end number should be exclusive, not inclusive.

Doc/reference/datamodel.rst

index ddfcb00fd788d7d50868d6e86f86e00b1613bd36..62e3ddab7599444826d57b4edd73da112d45b015 100644 (file)
@@ -1263,20 +1263,20 @@ Methods on code objects
 
    * ``start`` (an :class:`int`) represents the offset (inclusive) of the start
      of the :term:`bytecode` range
-   * ``end`` (an :class:`int`) represents the offset (inclusive) of the end of
+   * ``end`` (an :class:`int`) represents the offset (exclusive) of the end of
      the :term:`bytecode` range
    * ``lineno`` is an :class:`int` representing the line number of the
      :term:`bytecode` range, or ``None`` if the bytecodes in the given range
      have no line number
 
-   The items yielded generated will have the following properties:
+   The items yielded will have the following properties:
 
    * The first range yielded will have a ``start`` of 0.
    * The ``(start, end)`` ranges will be non-decreasing and consecutive. That
      is, for any pair of :class:`tuple`\s, the ``start`` of the second will be
      equal to the ``end`` of the first.
    * No range will be backwards: ``end >= start`` for all triples.
-   * The :class:`tuple` yielded will have ``end`` equal to the size of the
+   * The last :class:`tuple` yielded will have ``end`` equal to the size of the
      :term:`bytecode`.
 
    Zero-width ranges, where ``start == end``, are allowed. Zero-width ranges