Skip to content

Instantly share code, notes, and snippets.

@anfedorov
Created February 18, 2010 23:14
Show Gist options
  • Save anfedorov/308197 to your computer and use it in GitHub Desktop.
Save anfedorov/308197 to your computer and use it in GitHub Desktop.
>>> def foo(x,y):
while 1:
x = yield(x)
y = yield(y)
>>> f = foo(1,2)
>>> f.next()
1
>>> f.send(3)
2
>>> f.send(4)
3
>>> f.send(5)
4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment