This is intentional. wait() is a much lower-level API. You might have noticed that its return type is also different (two sets of futures, vs. a list of result values for gather()).
To add a timeout to any operation, wrap it in wait_for(). But wait_for() is implemented as a thin wrapper around wait()... On Tue, Jan 14, 2014 at 4:05 AM, Jonathan Slenders <[email protected]> wrote: > Following signatures look very similar: > > def wait(fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED) > def gather(*coros_or_futures, loop=None, return_exceptions=False): > > Except that for "wait", we expect a list of futures, while for "gather", we > expect the futures to be passed as args. > I was wondering whether this was intentional, because I had to replace > 'gather" with "wait" at one point and was confused about the API change. > > Is there also a reason why "gather" doesn't accept a timeout, but "wait" > does? -- --Guido van Rossum (python.org/~guido)
