gh-146362: Docs: add co_exceptiontable to code object documentation#146370
gh-146362: Docs: add co_exceptiontable to code object documentation#146370SHAHID-glitch wants to merge 2 commits intopython:mainfrom
Conversation
There was a problem hiding this comment.
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_exceptiontableunder code object attributes. - Document
co_exceptiontablein 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 |
There was a problem hiding this comment.
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.
| * - .. attribute:: co_exceptiontable | |
| * - .. attribute:: codeobject.co_exceptiontable |
| - A bytes object representing the exception handling table used by the interpreter. | ||
| This attribute was introduced in Python 3.11. | ||
|
|
There was a problem hiding this comment.
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`.
| - 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 |
|
Closing because the OP already suggested doing it. In addition, read our policy on LLMs: https://devguide.python.org/getting-started/generative-ai/. |
Fixes #146362
Added documentation for the
co_exceptiontableattribute in the code objects section of the data model.📚 Documentation preview 📚: https://cpython-previews--146370.org.readthedocs.build/
co_exceptiontablemissing in Data Model (Code objects) #146362