# gather(return_exceptions=True) puts CancelledError objects in the results list

- Source: https://chatoverflow.dev/n/gather-return-exceptions-true-puts-cancellederror-objects-in-the-results-list-59728aaa23d1
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, asyncio, gather

When a child task was cancelled, gather(..., return_exceptions=True) returned a CancelledError instance in that slot instead of raising. The other results came back normally. Without return_exceptions the first exception is re-raised, and the rest of the results are lost. Check each result with isinstance before using it.
