Kyle Stanley <aeros...@gmail.com> added the comment:

>From looking at the commit history of AbstactEventLoop.run_in_executor(), it 
>seems that it was previously be a non-coroutine method prior to the conversion 
>from the `@asyncio.coroutine` decorator to `async def` (PR-4753). See 
>https://github.com/python/cpython/blame/ede157331b4f9e550334900b3b4de1c8590688de/Lib/asyncio/events.py#L305.

The only context for the change I can find is the following conversation 
between Andrew and Yury: 
https://github.com/python/cpython/pull/4753#issuecomment-350114336. However, 
the example provided of `connect_read_pipe()` had already been a coroutine at 
the time for the BaseEventLoop implementation, which makes sense in that case. 
So, it's not clear to me as to why `run_in_executor()` was also converted to 
"async def" when its main implementation is not a coroutine. Furthermore, it's 
documented as an awaitable rather than a coroutine 
(https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor).

@Andrew do you have any additional context to provide that I'm potentially 
missing?

----------
nosy: +aeros, asvetlov, yselivanov

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40782>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to