Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def echo():
x = yield 'ready'
print(x)
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