Making immutable instances

Mike Meyer mwm at mired.org
Thu Dec 1 00:31:30 EST 2005


bonono at gmail.com writes:
> Mike Meyer wrote:
>> bonono at gmail.com writes:
>> > Well, in this case, would it be simple for the OP that if he wants to
>> > disallow this attaching additional things, just use __slot__.
>> That's *documented* as an implementation-dependent behavior. Using it
>> to get that effect is abuse of the feature, and may well quit working
>> in the future.
> It still won't affect what is working, so it is harmless side effect,
> if it ever changes in the future.

If not allowing is required, then allowing is "not working", pretty
much by definition.

> Abuse or not doesn't matter so long it fits the needs, IMO.

I guess it doesn't matter to you whether or not your code works in the
future. It does to me.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list