[Python-ideas] [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted (original) (raw)

Richard Oudkerk shibturn at gmail.com
Wed Jan 9 13:59:49 CET 2013


On 09/01/2013 12:51pm, Yuriy Taraday wrote:

exception() will raise only TimeoutError or CancelledError, exceptions from the Future computation are not raised, they are returned. So to verify that a Future is properly computed, you should write:

f.done() and not f.cancelled() and f.exception() is None and you won't have to catch any exceptions.

Ah. I missed the point that exception() returns None (rather than raising) if there was no exception.

-- Richard



More information about the Python-ideas mailing list