Asyncio -- delayed calculation

Chris Angelico rosuav at gmail.com
Tue Nov 29 00:43:38 EST 2016


On Tue, Nov 29, 2016 at 4:32 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Tuesday 29 November 2016 14:21, Chris Angelico wrote:
>
>> On Tue, Nov 29, 2016 at 1:23 PM, Steve D'Aprano
>> <steve+python at pearwood.info> wrote:
>>> This is confusing: why is this awaiting something inside an async function?
>>> Doesn't that mean that the await asyncio.gather(...) call is turned
>>> blocking?
>>
>> "await" means "don't continue this function until that's done". It
>> blocks the function until a non-blocking operation is done.
>
> So that would be... "yes"?

>From the point of view of the function, yes. From the point of view of
the rest of Python, no. It's a sign saying "Okay, Python, you can
alt-tab away from me now".

ChrisA



More information about the Python-list mailing list