I stand corrected. On Tue, Feb 25, 2014 at 2:38 PM, Peter Otten <__peter__@web.de> wrote:
Ram Rachum wrote:
This actually makes me think that `range(int('inf'))` is a more elegant construct than `itertools.count()`. Also `range(x, int('inf'))` for `itertools.count(x)`,
You could achieve that with range(None) or range(start, None) which would be similar to slices like items[start:None] aka items[start:].
and then you have `range(x, int('inf'), y)` or `range(0, int('-inf'), -1)` which `itertools.count` can't cover.
This *is* covered by count():
[x for x in itertools.islice(itertools.count(step=-2), 10)] [0, -2, -4, -6, -8, -10, -12, -14, -16, -18]
All you save is one import. In return you'll see your applications break in new and interesting ways ;)
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
--
--- You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/python-ideas/nFYbEpHrjlk/unsubscribe. To unsubscribe from this group and all its topics, send an email to python-ideas+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.