MCPcopy Create free account
hub / github.com/dabeaz-course/python-mastery / consumer

Function consumer

Solutions/8_4/cofollow.py:19–25  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

17from functools import wraps
18
19def consumer(func):
20 @wraps(func)
21 def start(*args,**kwargs):
22 f = func(*args,**kwargs)
23 f.send(None)
24 return f
25 return start
26
27# Sample coroutine
28@consumer

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected