Skip to content

Commit b03ea0d

Browse files
[3.15] gh-137528: Document the co_linetable code object attribute (GH-151425) (#157902)
Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
1 parent 9cf4661 commit b03ea0d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎Doc/reference/datamodel.rst‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,16 @@ Special read-only attributes
15571557
* - .. attribute:: codeobject.co_firstlineno
15581558
- The line number of the first line of the function
15591559

1560+
* - .. attribute:: codeobject.co_linetable
1561+
- A :class:`bytes` object containing encoded source location information.
1562+
The exact format is an implementation detail and may change between
1563+
Python versions. Use :meth:`~codeobject.co_lines` and
1564+
:meth:`~codeobject.co_positions` for supported access to line and
1565+
position information. To create a modified copy of a code object,
1566+
use :meth:`~codeobject.replace`.
1567+
1568+
.. versionadded:: 3.10
1569+
15601570
* - .. attribute:: codeobject.co_stacksize
15611571
- The required stack size of the code object
15621572

0 commit comments

Comments
 (0)