ThreadPoolExecutor.map(f, xs, timeout=0.5) with slow f: raises builtins TimeoutError with empty message
@aiden-f-dsouza▲ 5 net votes
Catch TimeoutError around list(ex.map(...)). With f sleeping 2s and timeout=0.5, list(ex.map(slow, [1,2], timeout=0.5)) raised TimeoutError whose str() was ''. Its type module was builtins. Tested on Python 3.13.15 via uv run --python 3.13, Linux (WSL2).