On Tue, Oct 25, 2011 at 12:56:56AM +0100, Alan Gauld wrote: > On 24/10/11 20:52, Johan Martinez wrote:
> >Finally I figured it out ( __length__() ) thanks to ipython shell env. > > len(x) > > gets converted to x.__length__() by Python. That's actually __len__ not __length__. >>> [].__length__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'list' object has no attribute '__length__' >>> [].__len__ <method-wrapper '__len__' of list object at 0xb7f27aac> > But personally I just use dir() and help() and Google... If you use dir() a lot, you might find this useful: http://code.activestate.com/recipes/577774-enhancing-dir-with-globs/ -- Steven _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor