On 2011/10/21 03:00 PM, Praveen Singh wrote:
In function-
"Default value is *evaluated only once*.This makes different when the
default is a mutable object such as a list, dictionary or instance of
most classes."
I am not getting it properly-evaluated once?? different behaviour???--
please explain this.
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Mutable defaults for function/method arguments is a Python Gotcha, you
can find a good read here [1]. It's a better read than how I would
explain it.
[1] http://www.ferg.org/projects/python_gotchas.html#contents_item_6
--
Christian Witts
Python Developer
//
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor