![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: bug or feature?
From: Fredrik Lundh <fredrik@pythonware.com>
Date: Wed Oct 05 2005 - 13:16:40 CEST
Steve Holden wrote:
> Interestingly I couldn't find this in the FAQ, though it *is* a
it's there:
http://www.python.org/doc/faq/general.html#why-are-default-values-shared-between-objects
(maybe "default values" should be changed to "default argument values")
it's also mentioned in chapter 4 of the tutorial:
http://docs.python.org/tut/node6.html#SECTION006710000000000000000
"*Important warning*: The default value is evaluated only once. This
(the text then illustrates this with examples, and shows how to do things
and in the description of "def" in the language reference:
http://docs.python.org/ref/function.html
"*Default parameter values are evaluated when the function definition
(the text then shows how to do things instead)
</F>
|