Skip to content

Instantly share code, notes, and snippets.

@joseanpg
Created March 13, 2011 20:11
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 joseanpg/868389 to your computer and use it in GitHub Desktop.
Save joseanpg/868389 to your computer and use it in GitHub Desktop.
def GenMaker():
j = 1
while True:
yield (yield 'Hola '+str(j))
j = j + 1
gen = GenMaker()
print( gen.__next__())
print( gen.__next__())
print( gen.__next__())
print( gen.__next__())
print( gen.__next__())
print( gen.__next__())
"""
Output
------
Hola 1
None
Hola 2
None
Hola 3
None
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment