Making immutable instances

Paul Rubin http
Wed Nov 30 01:36:37 EST 2005


Mike Meyer <mwm at mired.org> writes:
> Letting the class author declare whether or not the client can add
> attributes is wrong for the same reasons - and in the same places -
> that letting the class author declare that the client shouldn't be
> allowed to access specific attributes, and so on, is wrong.

The same logic can apply to what the class operations should do.  The
answer is the same in both cases.  That's why subclassing and
inheritance were invented.



More information about the Python-list mailing list