Inheritance and forward references (prototypes)

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Mon Jun 22 11:28:01 CEST 2009

Dave Angel a écrit :
> Default 
> arguments of class methods are evaluated during the definition of the 
> class

Default arguments of functions are eval'd during the execution of the 
def statement.

The fact that you use a def statement within a class statement's body is 
totally orthogonal - a def statement produces a function object, period.

It's only when resolved as a class attribute that a function "becomes" a 
method object (thanks to the descriptor protocol).

More information about the Python-list mailing list