On Tue, Apr 29, 2008 at 10:30 AM, Alexander Belopolsky <
[EMAIL PROTECTED]> wrote:

> or sizable.  I would say "range(n)  is a memory efficient substitute
> for [0, 1, ... n-1]" is easier to fit into one's brain that the
> current hodgepodge of exceptions.
>

For what it's worth, I'm -1 on any change that makes range(10**10)
an error.  I'd like to be able to write

for i in range(n):
    ...

without having to stop and worry about whether n is always going
to be small enough to avoid an exception, and what to do if there's
a possibility that n is large.  The common case of range should
have a small mental footprint.

Indexing a range object, or taking its length, are surely much rarer
than simply iterating over it;  I don't think the problems with indexing
and length are a good reason to impose restrictions on the use
of range as an iterable.

Mark
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to