May 2018
Intermediate to advanced
380 pages
9h 37m
English
def cor(): hi = yield "Hello" yield hi
cor = cor()
print(next(cor))
print(cor.send("World"))

def coroutine(funct): def wrapper(*args, **kwargs): cor = funct(*args, **kwargs) next(cor) return cor return wrapper
According to the official documentation (https://docs.python.org/3/library/asyncio-task.html#coroutines ...