Message208305
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. |
|
Date |
User |
Action |
Args |
2014-01-16 20:25:43 | r.david.murray | set | recipients:
+ r.david.murray, docs@python, m123orning, Fran.Bull |
2014-01-16 20:25:43 | r.david.murray | set | messageid: <1389903943.79.0.34105734447.issue20135@psf.upfronthosting.co.za> |
2014-01-16 20:25:43 | r.david.murray | link | issue20135 messages |
2014-01-16 20:25:43 | r.david.murray | create | |
|