and [True,True] --> [True, True]?????

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Apr 24 10:28:19 CEST 2009


On Thu, 23 Apr 2009 17:18:25 +0800, Leo wrote:

>> There's also the performance issue. I might have a sequence-like
>> structure where calling len() takes O(N**2) time, (say, a graph) but
>> calling __nozero__ might be O(1). Why defeat the class designer's
>> optimizations?
> 
> Is that true?
> Calling len() actually traverses the whole list?

Not for built-in lists, but for sequences created by somebody else, who 
knows what it does?



-- 
Steven



More information about the Python-list mailing list