更新
This commit is contained in:
12
Python-100-Days/Day66-75/code/myutils.py
Normal file
12
Python-100-Days/Day66-75/code/myutils.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from functools import wraps
|
||||
|
||||
|
||||
def coroutine(fn):
|
||||
|
||||
@wraps(fn)
|
||||
def wrapper(*args, **kwargs):
|
||||
gen = fn(*args, **kwargs)
|
||||
next(gen)
|
||||
return gen
|
||||
|
||||
return wrapper
|
||||
Reference in New Issue
Block a user