TheFlyingDutchman a écrit : > Well I'm with Bruce Eckel - there shouldn't be any argument for the > object in the class method parameter list.
def fun(obj, *args, **kw): # generic code here that do something with obj import some_module some_module.SomeClass.fun = fun This is why uniformity is important. But anyway, I think it's quite clear that Python won't drop the explicit self, so it looks like you have to live with it or choose another language. > Bruce said that no other mainstream OO language is explicitly passing > the object as a parameter to class methods. to methods. class methods gets the class as first parameter. Anyway, there are a lot of things that Python doesn't do like "other mainstream OO languages", and that's a GoodThing. > What I would like to have seen added to class definitions was the > forced declaration of all object variables in the class outside of > methods. I don't like the fact that they have to be, and can be > created in any method on the fly. I definitively think you'd be happier with some other language. -- http://mail.python.org/mailman/listinfo/python-list