Making immutable instances

Mike Meyer mwm at mired.org
Fri Nov 25 20:50:41 EST 2005


Steven D'Aprano <steve at REMOVETHIScyber.com.au> writes:
> On Thu, 24 Nov 2005 11:44:16 -0500, Mike Meyer wrote:
>> In Python, I can even fix
>> it so *your* code uses my wrapped version:
>> 
>> import Finney
>> class Addable(Finnney.Immutable): pass
>> Finney.Immutable = Addable
>
> Python's consenting adults philosophy allows the class designer some
> limited ability to force the class user to think about it before messing
> about with private variables. I think Ben's immutable class falls into
> that same category.

If you read the whole thread, you'll see that I don't have a problem
with messing with private variables. It's disallowing the addition of
new variables that I found objectionable.

    <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