Paul Rubin wrote: > "Giovanni Bajo" <[EMAIL PROTECTED]> writes:
[pay attention to the quoting, I didn't write that :) ] >>> Mike Meyer wrote: >>> >>> 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. I guess it might be argued that the method serialize() could return whatever value it returned before, and that the added attribute could be "optional" (eg. think of it as a cache that can be recomputed from the immutable attributes at any time). It's kind of a grey area. Surely, I would *not* mind if language support for immutability prohibited this :) -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list