从无法访问的项目Fork
体验新版 GitCode,发现更多精彩内容 >>
from functools import wraps def coroutine(fn): @wraps(fn) def wrapper(*args, **kwargs): gen = fn(*args, **kwargs) next(gen) return gen return wrapper