Using concurrent.futures.Future directly

I was looking into re-raising exceptions from callbacks ran in an another thread, from async a future immediately came to mind as a solution, but concurrent.futures.Future is documented with

Future instances are created by Executor.submit() and should not be created directly except for testing.

What’s the reason for this limitation and is there any alternative available in the stdlib? It looks like there are some other users of it in the stdlib other than Executor.

The reason is probably that its internals are designed for concurrent, and aren’t really too reusable. It’s not stdlib, but you might be interested in the outcome package. That’s designed for capturing a return value/raised exception from a function, then raising/returning it elsewhere.