Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-141004: DocumentPyTraceBack* APIs#141192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
Uh oh!
There was an error while loading.Please reload this page.
| Return true if *op* is a traceback object, false otherwise. This function | ||
| does not account for subtypes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| Return true if *op* is a traceback object, false otherwise. This function | |
| does not account for subtypes. | |
| Return true if *op* is a traceback object, false otherwise. This function | |
| does not account for subtypes. This is a macro. |
This is technically a macro, not a function, I see forByte Array Objects we have a "Type Check Macros" section, I think it would be good to note it some way here too (I think the subheadings would be better), WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I agree, but we don't do this anywhere else. As far as I know, all_Check functions are documented as functions, but they're really macros. Do you strongly believe we should document it as such here?
| Replace the:attr:`~BaseException.__traceback__` attribute on the current | ||
| exception with a new traceback pointing to *f*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| Replace the:attr:`~BaseException.__traceback__` attribute on the current | |
| exception with a new traceback pointing to *f*. | |
| Add theframe *f* to the:attr:`~BaseException.__traceback__` attribute on | |
| the current exception. |
I thinkreplace gives the wrong idea here, since we are extending it from my understanding.
ZeroIntensityNov 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'd say that it replaces it. All exceptions have the__traceback__ attribute, but sometimes it'sNULL/None. In all cases, we're overwriting that pointer. Saying we're "adding" the attribute seems wrong, because that would imply we're adding something new to an attribute dictionary.
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
📚 Documentation preview 📚:https://cpython-previews--141192.org.readthedocs.build/en/141192/c-api/exceptions.html#tracebacks