list.__len__() or len(list)

Nikhil mnikhil at gmail.com
Tue May 13 19:57:07 EDT 2008


which one is better? and why?

__len__() is a built-in function of the list object and is updated along 
with the list object elements and will be useful incase the list is very 
huge.

len() is an external method again, which may require the processing 
cycles again.

Is it right?



More information about the Python-list mailing list