Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def echo():
x = yield 'ready'
f = echo()
f.send(None) # Moves to the yield line, gets 'ready'
f.send('hi') # Sends hi but throws StopIteration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.