Bruno Desthuilliers wrote: > You wouldn't write something like 2.__add__(3), would you ?
Don't give the "it's only OO if I write obj.method(args)" crowd more bad ideas, please ;-)
(...as Bruno implies, setattr(), len() et al can be and should be viewed as generic functions. A specific Python implementation may use custom code to implement behaviour for a given object; behaviour that's more efficient than a full Python-level method call. For example, in CPython, len(L) is about twice as fast as L.__len__() for built-in sequences.)
</F> -- http://mail.python.org/mailman/listinfo/python-list