Making immutable instances

Paul Rubin http
Thu Nov 24 20:19:19 EST 2005


"Giovanni Bajo" <noway at sorry.com> writes:
> > However, when you prevent a client from adding an attribute, you're
> > not merely making your objects immutable, you're making them
> > static.

No I don't believe that.  If an object is immutable, then
obj.serialize() should return the same string every time.  If you can
add attributes then the serialization output will become different.



More information about the Python-list mailing list