[Python-Dev] Importance of "async" keyword

Sven R. Kunze srkunze at mail.de
Thu Jul 2 22:55:09 CEST 2015


My understanding of coloring is "needs special treatment".

Being special or not (containing an 'await' or not), as long as I don't 
need to care, I can call them either way (with 'await' or not) and each 
case works sensibly that's fine with me.

Sensible would be something similar to:

call function: business as usual
await function: suspension point and runs the function until completion
call awaitable: runs the awaitable until completion
await awaitable: suspension point and could be suspended internally as well

On 02.07.2015 00:02, Greg Ewing wrote:
> Sven R. Kunze wrote:
>> I like the 'await' syntax to mark suspension points. But the 'async' 
>> coloring makes no sense to me. It is an implementation details of 
>> asyncio (IMHO).
>
> Functions containing an "await" are going to be coloured
> in any case -- that's unavoidable, given that await is
> built on the iterator protocol. The only question is
> whether to have an explicit marker for it.
>



More information about the Python-Dev mailing list