On 2 March 2015 at 10:12, Victor Stinner <[email protected]> wrote:

> Hi,
>
> To answer Luciano's question on as_completed(), I read the source code
> of the function. It's not clear to me what happens on timeout.
>
>
> Should we abort something on timeout? The documentation doesn't
> explain if tasks are cancelled or if an exception is set. In the code,
> it's clear that the task is not touched. It's probably just a
> documentation issue.
>

I think it should cancel the wrapped task.  I think this is what the
programmer will want most of the time, and in case he doesn't want it he
can use shield() to prevent it.

Also it makes it consistent with wait_for:

https://code.google.com/p/tulip/issues/detail?id=107
http://bugs.python.org/issue23219


>
>
> Coroutine objects are wrapped into tasks: on timeout, these temporary
> tasks may be destroyed before their completion. A warning is emited in
> this case. The warning is useless, since the caller doesn't have
> access to all these temporary tasks. As gather(), we should probably
> set the _log_destroy_pending attribute of these tasks to False. What
> do you think?


> Victor
>



-- 
Gustavo J. A. M. Carneiro
Gambit Research
"The universe is always one step beyond logic." -- Frank Herbert

Reply via email to