I wish asyncio had a `group()` function, see the snippet. Basically a version of `gather()` that uses a TaskGroup under the hood. Clear cancellation strategy when things go wrong and exception groups. Example: `r1, r2 = await group(thing1(), thing2())` Should I?

Oct 3, 2025 · 6:29 PM UTC

5
2
32
Replying to @1st1
aiotools.readthedocs.io/en/l… I've made it by myself... I also need an option NOT to cancel siblings but let all subtasks run to completion.
1
1
Replying to @1st1
For the neophytes, what would the benefit of that approach over the simple gather() would be?
gather() should be "soft deprecated" because of bad cancellation behavior and lack of exception groups (making it unergonomic to catch errors from it)
2
Replying to @1st1
I have wanted this a number of times
1
3
Replying to @1st1
If I’m correct, the difference between gather and group api is a better exception handle? Correct me plz if I’m wrong
1