[Python-3000] range() issues

Greg Ewing greg.ewing at canterbury.ac.nz
Thu May 1 01:14:08 CEST 2008


Guido van Rossum wrote:
> On Wed, Apr 30, 2008 at 3:49 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> 
>> So that code will silently behave as though the rest of
>> the sequence wasn't there some of the time?
> 
> Only if it uses LBYL.

I don't understand that. Iteration isn't the only thing
one does with sequences. If you have a reason to call
len() in the first place, I don't see how having it
sometimes return inaccurate results can be helpful.

>> Can you elaborate on the rationale for this?

> Ask the designers of the Java collections package.

Do you mean that they have a rationale which you agree
with and think applies to Python as well, or do you
mean that you're doing it just because Java does it
and they must have a good reason?

If the former, can you refer me to a document which
espouses it?

-- 
Greg



More information about the Python-3000 mailing list