[Python-ideas] async/await and synchronous code (and PEP492 ?)

Koos Zevenhoven koos.zevenhoven at aalto.fi
Wed May 6 01:19:04 CEST 2015


Hi all,

I noticed a typo in my first email (had written__aenter__ instead of 
__enter__). I fixed the typo below.

-- Koos


On 5.5.2015 16:55, Koos Zevenhoven wrote:
>
> Relation to PEP492:
>
> This of course still needs more thinking, but I wanted to post it here 
> now in case there is desire to prepare for something like this already 
> in PEP492. It is not completely clear if/how this would need to affect 
> PEP492, but some things come to mind. For example, this could 
> potentially remove the need for __aenter__, __aiter__, etc. or even 
> "async for" and "async with". If __enter__ is defined as "async def", 
> then a with statement would do an "await" on it, and the context 
> manager would have __async__.framework (or whatever it would be 
> called) available, for determining what behavior is appropriate.
>



More information about the Python-ideas mailing list