I think that for this functionality (force the event loop to run), the trampoline just needs to define a function that returns a magic value and special-case that. The helper then becomes 

def __sleep0():
    await <magic>

The magic object may have to be something with an __await__() method.

On Fri, Feb 19, 2021 at 01:34 Luciano Ramalho <luciano@ramalho.org> wrote:
On Fri, Feb 19, 2021 at 6:29 AM Luciano Ramalho <luciano@ramalho.org> wrote:
> async def __sleep():
>     return None

Sorry, I meant to write:

async def __sleep0():
    return None

Since the idea is to replace the generator-based coroutine `__sleep0`
in tasks.py [1] with a native coroutine.

[1] https://github.com/python/cpython/blob/e92d67dfbb4790df37aa6a0961fb6dc7e8d2fbbf/Lib/asyncio/tasks.py#L585

--
Luciano Ramalho
|  Author of Fluent Python (O'Reilly, 2015)
|     http://shop.oreilly.com/product/0636920032519.do
|  Technical Principal at ThoughtWorks
|  Twitter: @ramalhoorg
--
--Guido (mobile)