python Programming Glossary: mygenerator
The Python yield keyword explained http://stackoverflow.com/questions/231767/the-python-yield-keyword-explained the values in memory they generate the values on the fly mygenerator x x for x in range 3 for i in mygenerator ... print i 0 1 4.. on the fly mygenerator x x for x in range 3 for i in mygenerator ... print i 0 1 4 It is just the same except you used instead.. you used instead of . BUT you can not perform for i in mygenerator a second time since generators can only be used once they calculate..
|