John Nagle wrote:
On 10/21/2010 2:51 PM, Chris Rebert wrote:

This is a common newbie stumbling-block: Don't use lists (or anything
mutable) as default argument values

    That really should be an error.

No, it shouldn't. The criterion isn't whether the object is
mutable, but whether you actually mutate it. If you treat it
as read-only, there's no problem.

Since not all Python data types have immutable variants,
sometimes it's necessary to do this.

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to