functions, list, default parameters

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Wed Nov 3 08:52:16 CET 2010


In message
<5f6eceec-1eef-4db7-82a6-e5f553349229 at k22g2000yqh.googlegroups.com>, Ian 
wrote:

> It seems to me that there is a rather simple case to be made for
> allowing mutable default arguments: instances of user-defined classes
> are fundamentally mutable.  Disallowing mutable default arguments
> would mean disallowing instances of user-defined classes entirely.
> That would be excessive and would violate Python's general rule of
> staying out of the programmer's way.

Unless you offered a way for user-defined classes to declare that they were 
immutable.



More information about the Python-list mailing list