13 lines
190 B
Python
13 lines
190 B
Python
|
from functools import wraps
|
||
|
|
||
|
|
||
|
def coroutine(fn):
|
||
|
|
||
|
@wraps(fn)
|
||
|
def wrapper(*args, **kwargs):
|
||
|
gen = fn(*args, **kwargs)
|
||
|
next(gen)
|
||
|
return gen
|
||
|
|
||
|
return wrapper
|