I'm running this program to create a iterator but I get a memory error even before it started printing anything.
def test():
for x in range(10000000000000):
yield x
for x in test():
print 'hi'
output:
tutorial@p1980:~/tej$ python itertest.py
Traceback (most recent call last):
File "itertest.py", line 7, in <module>
for x in test():
File "itertest.py", line 4, in test
for x in range(10000000000000):
MemoryError