Re: Why are class methods not classmethods?

2007-11-27 Thread Chris Mellon
On Nov 27, 2007 3:12 AM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > There's some subtle behaviour going on here that I don't really follow. > Class methods apparently aren't classmethods. > > > >>> class Parrot(object): > ... def method(self, *args): > ... return self, args > ...

Re: Why are class methods not classmethods?

2007-11-27 Thread Marc 'BlackJack' Rintsch
On Tue, 27 Nov 2007 09:12:28 +, Steven D'Aprano wrote: > Can anyone explain why class methods bound to a class are instancemethods > rather than classmethods? I'd say because they are bound to the class which is the instance that is passed as first argument. Just like unbound methods turn i

Why are class methods not classmethods?

2007-11-27 Thread Steven D'Aprano
There's some subtle behaviour going on here that I don't really follow. Class methods apparently aren't classmethods. >>> class Parrot(object): ... def method(self, *args): ... return self, args ... @classmethod ... def cmethod(cls, *args): ... return cls, arg