[Python-Dev] PEP 492: async/await in Python; version 5

Paul Moore p.f.moore at gmail.com
Tue May 5 23:01:12 CEST 2015


On 5 May 2015 at 21:00, Yury Selivanov <yselivanov.ml at gmail.com> wrote:
> On 2015-05-05 3:40 PM, Jim J. Jewett wrote:
>>
>> On Tue May 5 18:29:44 CEST 2015, Yury Selivanov posted an updated PEP492.
>>
>> Where are the following over-simplifications wrong?
>>
>> (1)  The PEP is intended for use (almost exclusively) with
>> asychronous IO and a scheduler such as the asynchio event loop.
>
> Yes. You can also use it for UI loops.  Basically, anything
> that can call your code asynchronously.

Given that the stdlib doesn't provide an example of such a UI loop,
what would a 3rd party module need to implement to provide such a
thing? Can any of the non-IO related parts of asyncio be reused for
the purpose, or must the 3rd party module implement everything from
scratch?

To me, this is an important question, as it cuts directly to the heart
of the impression people have that coroutines and async are "only for
asyncio".

I'd be interested in writing, for instructional purposes, a toy but
complete event loop. But I'm *not* really interested in trying to
reverse engineer the required interface.

Paul


More information about the Python-Dev mailing list