[Python-ideas] Built-in function to run coroutines

Sven R. Kunze srkunze at mail.de
Mon Nov 14 13:35:32 EST 2016


What about making "run" an instance method of coroutines?


On 14.11.2016 19:30, Yury Selivanov wrote:
> Hi Guido,
>
>
> On 2016-11-12 4:24 PM, Guido van Rossum wrote:
>> I think there's a plan to add a run() function to asyncio, which 
>> would be
>> something akin to
>>
>> def run(coro):
>>      return get_event_loop().run_until_complete(coro)
>>
>> (but perhaps with better cleanup).
>
> Please see https://github.com/python/asyncio/pull/465.


Best,
Sven


More information about the Python-ideas mailing list