Inheritance and forward references (prototypes)

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


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

<pedantic>
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).
</pedantic>



More information about the Python-list mailing list