homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author georg.brandl
Recipients georg.brandl, warnhold
Date 2008年04月06日.08:30:50
SpamBayes Score 0.0816334
Marked as misclassified No
Message-id <1207470651.85.0.20913503608.issue2561@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, this is expected. Default values are only evaluated once, at
function creation time. If you need to have a mutable default argument
that is assigned to something and changed, use something like this:
def f(arg=None):
 if arg is None:
 arg = []
 ...
History
Date User Action Args
2008年04月06日 08:30:52georg.brandlsetspambayes_score: 0.0816334 -> 0.0816334
recipients: + georg.brandl, warnhold
2008年04月06日 08:30:51georg.brandlsetspambayes_score: 0.0816334 -> 0.0816334
messageid: <1207470651.85.0.20913503608.issue2561@psf.upfronthosting.co.za>
2008年04月06日 08:30:51georg.brandllinkissue2561 messages
2008年04月06日 08:30:50georg.brandlcreate

AltStyle によって変換されたページ (->オリジナル) /