Hi
On 07/17/2014 06:34 PM, Danny Yoo wrote:


Yeah; the default value is not reevaluated between calls.  It's a common
gotcha.  Here are a few links to read more:

http://effbot.org/zone/default-values.htm

http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments

Good luck!


Aha, the object that stores the default value for the optional argument is created at the time of the execution of the function definition and mutable objects do mutate, so that's that. It makes a lot of sense.
Thanks, Danny
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to