Quite often I find myself wanting to write an infinite for-loop, or rather a loop with a counter, that terminates on some inner condition. Recently I even wanted to do this together with the generator comprehension syntax, I don't remember exactly what I wanted to do, but it was something like:
<br>zip( some_list_of_unknown_length, ('a' for x in infinit_generator) )<br>I admit that my example is silly, but it still serves as an example of what I wanted to do.<br><br>Then I read that Ellipsis will become generally accepted in py3k [1] and thought why not let range accept ... as end-parameter to mean "until forever".
<br><br>More silly examples to demonstrate how it would work:<br><br>>>> for i in range(...):<br>...     print i<br>...     if i == 4: break<br>0<br>1<br>2<br>3<br>4<br>>>> for i in range(10,...,10):<br>
...     print i<br>...     if i == 40: break<br>10<br>20<br>30<br>40<br><br>Any thoughts on this?<br><br>/Tobias<br><br>[1] <a href="http://mail.python.org/pipermail/python-3000/2006-April/000996.html">http://mail.python.org/pipermail/python-3000/2006-April/000996.html
</a><br><br>