Skip to content

gh-146362: Docs: add co_exceptiontable to code object documentation#146370

Closed
SHAHID-glitch wants to merge 2 commits intopython:mainfrom
SHAHID-glitch:add-co-exceptiontable-doc
Closed

gh-146362: Docs: add co_exceptiontable to code object documentation#146370
SHAHID-glitch wants to merge 2 commits intopython:mainfrom
SHAHID-glitch:add-co-exceptiontable-doc

Conversation

@SHAHID-glitch
Copy link

@SHAHID-glitch SHAHID-glitch commented Mar 24, 2026

Fixes #146362

Added documentation for the co_exceptiontable attribute in the code objects section of the data model.


📚 Documentation preview 📚: https://cpython-previews--146370.org.readthedocs.build/

Copilot AI review requested due to automatic review settings March 24, 2026 11:08
@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Mar 24, 2026
@python-cla-bot
Copy link

python-cla-bot bot commented Mar 24, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds missing documentation for the code object attribute co_exceptiontable (introduced in Python 3.11) to the Data Model reference, addressing docs issue #146362.

Changes:

  • Add an index entry for co_exceptiontable under code object attributes.
  • Document co_exceptiontable in the “Special read-only attributes” table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- An :class:`integer <int>` encoding a number of flags for the
interpreter.

* - .. attribute:: co_exceptiontable
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the code object attribute table, this entry should use the same fully-qualified attribute name style as the others (e.g., codeobject.co_name). Using .. attribute:: co_exceptiontable here is inconsistent and may prevent correct cross-referencing/indexing for the attribute.

Suggested change
* - .. attribute:: co_exceptiontable
* - .. attribute:: codeobject.co_exceptiontable

Copilot uses AI. Check for mistakes.
Comment on lines +1554 to +1556
- A bytes object representing the exception handling table used by the interpreter.
This attribute was introduced in Python 3.11.

Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new attribute description doesn’t follow the version annotation/style used elsewhere in this table. Consider using :class:bytes`` (instead of plain “bytes object”) and the standard .. versionadded:: 3.11 directive rather than an inline sentence, to match surrounding entries like `co_qualname`/`co_positions`.

Suggested change
- A bytes object representing the exception handling table used by the interpreter.
This attribute was introduced in Python 3.11.
- A :class:`bytes` object representing the exception handling table used
by the interpreter.
.. versionadded:: 3.11

Copilot uses AI. Check for mistakes.
@SHAHID-glitch SHAHID-glitch changed the title Docs: add co_exceptiontable to code object documentation gh-146362: Docs: add co_exceptiontable to code object documentation Mar 24, 2026
@picnixz
Copy link
Member

picnixz commented Mar 24, 2026

Closing because the OP already suggested doing it. In addition, read our policy on LLMs: https://devguide.python.org/getting-started/generative-ai/.

@picnixz picnixz closed this Mar 24, 2026
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.

Docs: co_exceptiontable missing in Data Model (Code objects)

3 participants