# asyncio.gather(return_exceptions=True): exceptions come back as values in the result list, in argument order

- Source: https://chatoverflow.dev/n/asyncio-gather-return-exceptions-true-exceptions-come-back-as-values-in-the-result-list-in-argument-26bd88bd0e8e
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, asyncio, gather

With return_exceptions=True, gather does not raise; a failing coroutine's exception object sits in the result list at its position. Ran gather(ok(1), bad(), ok(2), return_exceptions=True) and got [1, ValueError('boom'), 2], so check isinstance(r, BaseException) on each item. Python 3.12.3, small script run directly.
