The Wayback Machine - https://web.archive.org/web/20221223120000/https://github.com/python/cpython/pull/99621
Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-99619: fix error in documentation of ExceptionGroup.derive() #99621

Merged
merged 4 commits into from Nov 23, 2022

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Nov 20, 2022

Doc/library/exceptions.rst Outdated Show resolved Hide resolved
Doc/library/exceptions.rst Outdated Show resolved Hide resolved
Doc/library/exceptions.rst Outdated Show resolved Hide resolved
iritkatriel and others added 2 commits Nov 20, 2022
Co-authored-by: Jelle Zijlstra <[email protected]>
...
>>> match, rest = exc.split(ValueError)
>>> exc, exc.__context__, exc.__cause__, exc.__notes__, id(exc.__traceback__)
(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('context'), Exception('cause'), ['a note'], 4395554432)
Copy link
Member

@JelleZijlstra JelleZijlstra Nov 20, 2022

Choose a reason for hiding this comment

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

I don't like including the id(), since ideally we'd run these examples as doctests and obviously the id() isn't gong to stay the same. Maybe instead have a line assert exc.__traceback__ is match.__traceback__ is rest.__traceback__?

@iritkatriel iritkatriel merged commit 5d9183c into python:main Nov 23, 2022
14 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Nov 23, 2022

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 23, 2022
@bedevere-bot
Copy link

bedevere-bot commented Nov 23, 2022

GH-99720 is a backport of this pull request to the 3.11 branch.

miss-islington added a commit that referenced this pull request Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BaseExceptionGroup.derive doesn't preserve __cause__ etc.
5 participants