Skip to content

PEP 654: Exception groups and except *, leading to asyncio TaskGroup #8508

@dhalbert

Description

@dhalbert

PEP 654 was recently added to CPython 3.11. It adds exceptions propagated together and a new except* syntax to handle them. Tracebacks handle this as well. This was considered a prerequisite to adding TaskGroup to asyncio, and delayed TaskGroup for about three years.

I am very fond of TaskGroup, and think it makes asyncio a lot easier to use. I think it will also be the style going forward, though it will take a while to catch on.

@dpgeorge and @jimmo, have you thought about when or if you might add TaskGroup, and whether you would add it compatibly (implementing PEP 654)? 654 seems pretty complicated and might add a lot of code, but I haven't looked at it in detail. Or might you add TaskGroup but not make it quite compatible?

BTW, the person who did async/await for CircuitPython added __await__. I think you are still using __iter__, but I wonder about whether you feel the need to add __await__ as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions