Brian Candler
Feb 8, 2023

--

Nice article. Minor note, your example of @types.coroutine needs some editing before it runs. Either remove the db arg, or pass a dummy value for it; and import asyncio.

import asyncio, types

async def magic_pot(db):

return 1

@types.coroutine

def process_magic_pot(db):

data = yield from magic_pot(db)

print(data)

pmp = process_magic_pot(None)

print(pmp)

asyncio.run(pmp)

--

--

No responses yet