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 r.david.murray
Recipients Fran.Bull, docs@python, m123orning, r.david.murray
Date 2014-01-16.20:25:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1389903943.79.0.34105734447.issue20135@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for working on this.

Technically, defaults are evaluated when the 'def' statement is executed, which is normally, but not always, at the time that the module is first imported (counterexample: nested function definitions).

The answer should also explicitly cover the more common mistake made with default keyword values of passing a mutable object and having it get persistently modified,and the question phrasing should reflect that.  The datetime example is a great first example before getting to the more common one, though.
History
Date User Action Args
2014-01-16 20:25:43r.david.murraysetrecipients: + r.david.murray, docs@python, m123orning, Fran.Bull
2014-01-16 20:25:43r.david.murraysetmessageid: <1389903943.79.0.34105734447.issue20135@psf.upfronthosting.co.za>
2014-01-16 20:25:43r.david.murraylinkissue20135 messages
2014-01-16 20:25:43r.david.murraycreate