On 4/6/2016 10:14 AM, Marko Rauhamaa wrote:
Seriously, Python wouldn't be, couldn't be Turing-complete without
"while" (mainly because it doesn't support tail-recursion elimination).
Now, if Python had an unlimited range() iterator/iterable, you could use
a "for" statement to emulate "while".
For practical purposes, this equals 'while True: pass'
for i in itertools.count: pass
This is equivalent, regardless of memory.
class whiletrue:
def __iter__(self): return self
def __next__(self): return None
for none in whiletrue(): pass
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list