Martin v. Löwis <[EMAIL PROTECTED]> added the comment:
I don't see the need to do anything about this. Python works correctly,
and the documentation correctly describes how it works, and how using
mutable objects as default values typically doesn't do what the
programmer normally expects.
In any
David W. Lambert <[EMAIL PROTECTED]> added the comment:
Mutable function arguments and class variables are python's mechanisms
to provide data persistence at these scope levels. Quite opposite of
design flaw, they are necessary! Write a decorator to change the
behavior where you'd like an emp
Grégoire Weber <[EMAIL PROTECTED]> added the comment:
I'd like to second rhr. The current behaviour is is not according to
Pythons design principle of least surprise. After 5+ years of Python
experience as Zope and Plone developer I recently fell into that trap.
-
Just for information (Disc
Christian Heimes <[EMAIL PROTECTED]> added the comment:
No, it is NOT a bug. The behavior will NOT chance. I'm marking this bug
as a documentation issue.
--
assignee: -> georg.brandl
components: +Documentation -Interpreter Core
nosy: +georg.brandl
versions: +Python 2.6, Python 2.7, Pyth
New submission from Robert Hunger <[EMAIL PROTECTED]>:
Reopening of issue 4181.
Evaluating default parameter values when the function definition is
executed is a design bug.
Even the documentation of this behaviour (see
http://docs.python.org/reference/compound_stmts.html#index-754) makes
this