Easy immutability in python?

jess.austin at gmail.com jess.austin at gmail.com
Sat Mar 4 13:22:04 EST 2006


To be clear, in this simple example I gave you don't have to override
anything.  However, if you want to process the values you place in the
container in some way before turning on immutability (which I assume
you must want to do because otherwise why not just use a tuple to begin
with?), then that processing should take place in a.__new__.

cheers,
Jess




More information about the Python-list mailing list