You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ExceptionGroups are useful for validating data and telling the user of multiple failures.
For example, if we are examining a string to see if it qualifies as a strong password (#10885) we want to see if it
is long enough
not too long
has lowercase characters
has uppercase characters
has acceptable special characters
does not have unacceptable special characters
does not have too much repetition
If each of these raised a separate exception then we could use an ExceptionGroup to tell the user all of the problems at once. We could tell them that the proposed password is too short and has no uppercase characters and has a ~ which is an unacceptable special character.
The contribution should solve a normal algorithm problem but should an ExceptionGroup to provide detailed feedback.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
https://docs.python.org/3/library/exceptions.html#exception-groups (New in Python 3.11)
ExceptionGroups
are useful for validating data and telling the user of multiple failures.For example, if we are examining a string to see if it qualifies as a strong password (#10885) we want to see if it
If each of these raised a separate exception then we could use an
ExceptionGroup
to tell the user all of the problems at once. We could tell them that the proposed password is too short and has no uppercase characters and has a~
which is an unacceptable special character.The contribution should solve a normal algorithm problem but should an
ExceptionGroup
to provide detailed feedback.Beta Was this translation helpful? Give feedback.
All reactions