>>> lst = [1,2,3] >>> len(lst) 3 >>> lst.__len__() 3
in genereal all objects which implements __len__ can be passed to built-in function len >>> len <built-in function len> just to give one example how this can be used >>> class X(object): ... def __len__(self): ... print "this instance has __len__" ... return 100 ... >>> x=X() >>> len(x) this instance has __len__ 100 >>> x.__len__() this instance has __len__ 100 hth, Daniel -- http://mail.python.org/mailman/listinfo/python-list