Skip to content

Instantly share code, notes, and snippets.

@swenson
Created July 23, 2013 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swenson/6058900 to your computer and use it in GitHub Desktop.
Save swenson/6058900 to your computer and use it in GitHub Desktop.
In [35]: def a():
a = yield 4
print a
....:
In [36]: b = a()
In [37]: b.next()
Out[37]: 4
In [38]: b.send(2)
2
In [30]: def a():
yield 4
x = yield
print x
....:
In [31]: b = a()
In [32]: b.next()
Out[32]: 4
In [33]: b.next()
In [34]: b.send(2)
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment