Giovanni Bajo wrote: > Thomas Guettler wrote: > >> I have read the FAQ to the len function: >> http://www.python.org/doc/faq/general/#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list > > Outdated. You want to read the new FAQ, here: > http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm
Why not replace the __len__ method with a len property for strings, lists, tuples, dictionaries etc. __len__ is not very special and the property len eliminates the redundant parentheses. Colin W. -- http://mail.python.org/mailman/listinfo/python-list