Next steps after PEP 654 (ExceptionGroups): TaskGroup, etc.?

Now that PEP 654 (ExceptionGroups and except*) is close to done (thank you Irit!), what are the next steps for asyncio? My understanding is that PEP 654 is a blocker for TaskGroup. Will there be a PEP for TaskGroup, or is it only a PR?

I personally would like to see mainly the following:

  • TaskGroup
  • An addition of a function similar to gather() that cancels the other tasks when one task raises an exception. This was originally a bug report against gather(), and was rejected.

I speak as a CircuitPython core developer. except* may not get into MicroPython (our primary source for core language features) any time soon. Nevertheless, we’d like to provide additions to our own asyncio that mimic upcoming CPython asyncio features, so we’d very interested in upcoming specs.

Thank you,
Dan

3 Likes

Taskgroups are now being added:

https://bugs.python.org/issue46752

A canceling version of gather() would still be nice too.

1 Like

I have filed two bpo issues:

I’d like to hear suggestions and feedbacks!