Function mistaken for a method

Christophe chris.cavalaria at free.fr
Fri Jun 2 05:03:34 EDT 2006


Maric Michaud a écrit :
> Le Jeudi 01 Juin 2006 15:36, Christophe a écrit :
> 
>>       self.x = self.__class__.f(0)
> 
> nope, this will result in a TypeError "unbound method must be called with 
> instance as first argument"

Your right :(

staticmethod it is then.



More information about the Python-list mailing list