Created
March 23, 2012 22:11
-
-
Save munro/2175562 to your computer and use it in GitHub Desktop.
Yield Foo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bar(): | |
return 'bar!' | |
def foo(v): | |
return 'foo! ' + v | |
def meow(): | |
yield foo((yield bar())) | |
a = meow() | |
print(a.send(a.next() + 'yield')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment