Skip to content

add async400 exceptiongroup-invalid-access - #379

Merged
jakkdl merged 3 commits into
python-trio:mainfrom
jakkdl:4xx
May 7, 2025
Merged

jakkdl merged 3 commits into
python-trio:mainfrom
jakkdl:4xx

Conversation

@jakkdl

@jakkdl jakkdl commented May 6, 2025

Copy link
Copy Markdown
Member

pretty straightforward, bulk of it is in avoiding false alarms

@jakkdl

jakkdl commented May 6, 2025

Copy link
Copy Markdown
Member Author

hm, in hindsight I maybe should've used TypeTrackerVisitor - but it's a non-trivial rewrite so /shrug

@Zac-HD Zac-HD left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

one more test as below, then let's go!

Comment on lines +17 to +28
EXCGROUP_ATTRS = (
# from ExceptionGroup
"message",
"exceptions",
"subgroup",
"split",
"derive",
# from BaseException
"args",
"with_traceback",
"add_notes",
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's add a test that set(dir(ExceptionGroup)).issubset(EXCGROUP_ATTRS), so that if a new method or attribute is added (e.g. by PEP-785 😅) we'll notice as soon as we test on that version of Python, rather than when users complain.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oopie, that caught a typo. Turns out it's add_note and not add_notes ^^;

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants