len()

Tino Wildenhain tino at wildenhain.de
Wed Feb 4 17:19:13 CET 2009


Marco Mariani wrote:
> Pat wrote:
> 
>> Why didn't you answer the len() question?
> 
> It's a bit of a FAQ: len() cannot be a method of list objects because it 
> works on any sequence or iterable.

Thats only half of the truth :-)

len() can use some internal optimizations on certain objects
where sequences indeed have a len() method called __len__()

Regards
Tino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20090204/356d1d72/attachment.bin>


More information about the Python-list mailing list