Skip to content

gh-137528: Document the co_linetable code object attribute#151425

Open
harjothkhara wants to merge 1 commit into
python:mainfrom
harjothkhara:gh-137528-doc-co-linetable
Open

gh-137528: Document the co_linetable code object attribute#151425
harjothkhara wants to merge 1 commit into
python:mainfrom
harjothkhara:gh-137528-doc-co-linetable

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Documents the previously-undocumented codeobject.co_linetable attribute in the data model reference. The new entry states it's a bytes object of encoded source-location information, notes the exact format is an implementation detail that may change between versions, explains it exists to support creating new code objects (PEP 626), and points readers to co_lines()/co_positions() for supported access. Adds an index entry and a .. versionadded:: 3.10.

Docs-only.

Disclosure: AI-assisted wording; reviewed by me.

Document the public ``codeobject.co_linetable`` attribute in the data
model reference. It holds encoded source location information in an
opaque, version-specific format and is exposed to support the creation
of new code objects; readers are pointed to ``co_lines()`` and
``co_positions()`` for supported access.
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33120905 | 📁 Comparing 0a8c95b against main (f4f1020)

  🔍 Preview build  

1 file changed
± reference/datamodel.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant