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
Is your feature request related to a problem? Please describe.
PEP-654 proposes a new "exception groups" feature, and a new except* syntax to implement it. This will come with Python 3.11 (so Cython probably shouldn't try to implement it until Python 3.11 is released just in case there are any changes).
I'm sure you're exaggerating, but maybe the following helps. The whole feature is designed around helping deal with multiple exceptions being raised concurrently1 within a given block of code (e.g. several threads, or async, or ...).
To correctly reflect this, there needs to be something exception-like - i.e. can be caught/handled/rethrown - that can hold multiple individual exceptions (trio originally called this MultiError, cpython now chose ExceptionGroup), and the whole try:/except: game now needs to be able to deal with these containers, with some new additional operations (mainly filtering) due to now having (potentially) several different exceptions in one group.
In order not to break existing code through subtly different exception semantics between single exceptions and ExceptionGroups, this needed new syntax (except*) to distinguish intent2. There's more details regarding serialization, stacks, tracing, etc., but that's it.
Footnotes
obviously those exceptions will not happen at the exact same instant in time, but from the point of view of the parent thread/nursery, when all the threads return control, several exceptions might have happened. ↩
If except SomeException had been empowered to filter SomeException out of ExceptionGroups that contain one, there could be cases that behave differently than before. ↩
Is your feature request related to a problem? Please describe.
PEP-654 proposes a new "exception groups" feature, and a new
except*
syntax to implement it. This will come with Python 3.11 (so Cython probably shouldn't try to implement it until Python 3.11 is released just in case there are any changes).See https://peps.python.org/pep-0654/.
Additional context
I don't understand this feature at all right now and wasn't planning to implement it myself...
The text was updated successfully, but these errors were encountered: