This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aeros
Recipients aeros, asvetlov, jamesba, yselivanov
Date 2020-05-27.03:37:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590550628.45.0.931904621528.issue40782@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2020-05-27 03:37:08aerossetrecipients: + aeros, asvetlov, yselivanov, jamesba
2020-05-27 03:37:08aerossetmessageid: <1590550628.45.0.931904621528.issue40782@roundup.psfhosted.org>
2020-05-27 03:37:08aeroslinkissue40782 messages
2020-05-27 03:37:08aeroscreate