Y
Hacker News
new
|
ask
|
show
|
jobs
by
joshuamorton
2961 days ago
Only if you iterate over a fixed-length iterable.
[x for x in itertools.count()]
will never terminate.
1 comments
heavenlyblue
2951 days ago
It will terminate as soon as it runs out of memory.
link
joshuamorton
2951 days ago
By this definition, python has a nice locally defined property that it will always terminate ;)
link
heavenlyblue
2950 days ago
No; this will never-ever terminate:
(x for x in itertools.count())
link