Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-142392: UpdateExceptionGroups in docs to use a tuple of errors where possible#142393

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

Open
dr-carlos wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromdr-carlos:exception-group-repr-docs

Conversation

@dr-carlos
Copy link
Contributor

@dr-carlosdr-carlos commentedDec 7, 2025
edited by github-actionsbot
Loading

@picnixz
Copy link
Member

Was it discussed in the PR and deemed a better way alternative? I personally prefer using[] because it's more natural to() on my keyboard but I wonder whether we really need to do mention this in the docs. It's fine to use a list right? I also think it has a nicer rendering as otherwise we have nested(.

@dr-carlos
Copy link
ContributorAuthor

dr-carlos commentedDec 7, 2025
edited
Loading

Was it discussed in the PR and deemed a better way alternative? I personally prefer using[] because it's more natural to() on my keyboard but I wonder whether we really need to do mention this in the docs. It's fine to use a list right? I also think it has a nicer rendering as otherwise we have nested(.

It certainly isn't vastly superior, just slightly more efficient.@iritkatriel asked me to open an issue to update the docs, so I opened an issue and PR for it since there aren't many changes.

When you runrepr() on anExceptionGroup, if the original sequence was a list, then we need to create a new list from theeg.exceptions tuple, which could be expensive for a large list. This step is unnecessary for tuples as we just use the repr foreg.exceptions straight-up. So it's slightly more efficient (though of minimal effect for small groups).

@picnixz
Copy link
Member

Yes it could be expensive but exception handlers are usually rare paths, so performance usually aren't an issue here. Unless you have a list of millions of exception objects, it doesn't really matter IMO.

@iritkatriel
Copy link
Member

I agree it's not a significant perf impact. My point is it's inconsistent to recommend in the docs to use tuples and then have examples using [].

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@willingcwillingcAwaiting requested review from willingcwillingc is a code owner

@AA-TurnerAA-TurnerAwaiting requested review from AA-TurnerAA-Turner is a code owner

Assignees

No one assigned

Labels

awaiting reviewdocsDocumentation in the Doc dirskip news

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@dr-carlos@picnixz@iritkatriel

[8]ページ先頭

©2009-2026 Movatter.jp