Making immutable instances

Giovanni Bajo noway at sorry.com
Thu Nov 24 02:54:36 EST 2005


Mike Meyer wrote:

>> If it's not a wart, why would it be a wart for user-defined types to
>> have the same behaviour?
>
> It's a wart because user-defined classes *don't* have the same
> behavior.

Then *my* solution for this would be to give user-defined classes a way to
behave like builtins, eg. explicitally and fully implement immutability.
Immutability is an important concept in Python programs, and I'm impressed it
does not have explicit support.
-- 
Giovanni Bajo





More information about the Python-list mailing list