This repository was archived by the owner on Apr 10, 2022. It is now read-only.
This repository was archived by the owner on Apr 10, 2022. It is now read-only.
Decide whether to include asyncio adoption in the ExceptionGroups PEP #19
Closed
Description
Below is a section of the first draft of the PEP, which I have removed because at the moment it's out of place.
We need to decide whether we want to add a spec of the asyncio adoption of ExceptionGroups/except*
to this PEP at all, and if so then this paragraph can be added along with an explanation of what that integration involves.
See discussion on a PR: #16 (comment)
### Adoption of try..except* syntax
Application code typically can dictate what version of Python it requires.
Which makes introducing TaskGroups and the new `except*` clause somewhat
straightforward. Upon switching to Python 3.10, the application developer
can grep their application code for every *control flow* exception they handle
(search for `except CancelledError`) and mechanically change it to
`except *CancelledError`.
Library developers, on the other hand, will need to maintain backwards
compatibility with older Python versions, and therefore they wouldn't be able
to start using the new `except*` syntax right away. They will have to use
the new ExceptionGroup low-level APIs along with `try..except ExceptionGroup`
to support running user code that can raise exception groups.