https://github.com/python/cpython/commit/eb22afb0042b09f05de5077c1947053dfbf7a5c0 commit: eb22afb0042b09f05de5077c1947053dfbf7a5c0 branch: 3.12 author: Miss Islington (bot) <[email protected]> committer: erlend-aasland <[email protected]> date: 2024-01-12T15:10:43Z summary:
[3.12] Docs: Amend codeobject.co_lines docs; end number is exclusive (GH-113970) (#113987) The end number should be exclusive, not inclusive. (cherry picked from commit e68806c7122070078507b370b13bb225f8501ff8) Co-authored-by: Ned Batchelder <[email protected]> files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index fe39b82846039f..b4d404696940c3 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -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 _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
