Paolino wrote: > I imagine that a method implementation of them inside the type metaclass > could be better specified by people.
What you ask for is unimplementable. Method objects are created only when the method is accessed, not (even) when the class is created. Watch this: >>> class X: ... def foo(self): ... pass ... >>> x=X() >>> type(x.foo) <type 'instancemethod'> >>> type(X.__dict__['foo']) <type 'function'> So even though the class has long been defined, inside X's dictionary, foo is still a function. Only when you *access* x.foo, a method object is created on the fly: >>> x.foo is x.foo False Therefore, a decorator function cannot possibly get access to the method object - it simply doesn't exist. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com