[Async-sig] asyncio.timeout() is not portable

Andrew Svetlov andrew.svetlov at gmail.com
Thu Jun 9 00:38:20 EDT 2016


My first thought was to use `async with` but I found that just `with` also
works.

Sorry, but I don't follow how async context manager may be better.

On Wed, Jun 8, 2016 at 10:49 AM Yury Selivanov <yselivanov at gmail.com> wrote:

>
> > On Jun 8, 2016, at 1:15 PM, Andrew Svetlov <andrew.svetlov at gmail.com>
> wrote:
> >
> > asyncio.timeout behaves like asyncio.wait_for BTW.
> > It cancels inner tasks and sends asyncio.TimeoutError to outer.
>
> Right.  And I think it’s a totally normal behaviour for asyncio.
>
> The only thing I’d fix in asyncio.timeout() (aside from resolving
> Ben’s questions) is to make it use ‘async with’ statement.
>
> Yury
>
> --
Thanks,
Andrew Svetlov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/async-sig/attachments/20160609/3dd7d8ce/attachment-0001.html>


More information about the Async-sig mailing list