-
Notifications
You must be signed in to change notification settings - Fork 713
Open
Description
After reading through the presentation by David Beazley (the link at the bottom of your coroutines page), I noticed he wrote a nice decorator to help set up a coroutine. It looks like this:
def coroutine(func):
def start(*args,**kwargs):
cr = func(*args,**kwargs)
cr.next()
return cr
return start
@coroutine
def grep(pattern):
...You may want to add in reasons why people would use coroutines. For example, as part of a pipeline or filter. Slides 2-23 of David Beazley's presentation may be useful to help with examples and explanations.
I'd be interested to see what other uses for coroutines you find, especially since this is the first time I've seen them in Python.
Metadata
Metadata
Assignees
Labels
No labels