Guido van Rossum wrote:
> It ought to be called @instancemethod for a better analogy.

That's actually what I was originally going to suggest.

And then I changed my mind after wondering how I would answer the question 
"Why don't I need to decorate functions with @instancemethod in order to use 
them as instance methods, but I need to decorate them with @classmethod and 
@staticmethod to use them as class and static methods?".

However, now that I've thought about it some more, the explanation would 
simply be that functions behave like instancemethod instances by default, 
while other callables typically behave like staticmethod instances.

So instancemethod(f) would return the passed in object for an actual function, 
and a wrapper with an appropriate __get__ method for anything else (stealing 
__doc__ etc from the original callable).

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
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

Reply via email to