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

iritkatriel and others added 2 commits November 20, 2022 15:43
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
...
>>> 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

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__?

@miss-islington
Copy link
Contributor

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
…pythonGH-99621)

(cherry picked from commit 5d9183c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
@bedevere-bot
Copy link

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

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Nov 23, 2022
miss-islington added a commit that referenced this pull request Nov 23, 2022
…9621)

(cherry picked from commit 5d9183c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
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