Skip to content

Instantly share code, notes, and snippets.

@rks987
rks987 / prependGen.py
Created Dec 7, 2017
cons for python generators
View prependGen.py
def prependGen(hd,tl):
yield hd
yield from tl
if __name__=="__main__":
h = (x for x in range(1,3))
h = prependGen(0,h)
print(*h)
You can’t perform that action at this time.