Chris Rebert a écrit :
(snip)

Default values are only evaluated once, when the class is defined,

<clarification target="newcomers">

s/class/function/

The function objects (defined in a class statement body...) are created before the class object itself.

</clarification>

thus "self" is not defined at that point since the class is still
being defined when the method definition is executed and thus there
can be no instances yet anyway.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to