hashkey/digest for a complex object

kj no.email at please.post
Thu Oct 7 06:42:43 EDT 2010


In <mailman.1415.1286438617.29448.python-list at python.org> Terry Reedy <tjreedy at udel.edu> writes:

>If these two attributes, and hence the dicts, are public, then your 
>instances are mutable.

I guess I should have written "immutable among consenting adults."

As far as I know, Python does not support private attributes, so
I guess the dicts are public no matter what I do.  I suppose that
I can implement "frozendict", but I can't think of any way to
enforce the immutability of these "frozendicts" that would not be
trivial to circumvent (it better be, in fact, otherwise I wouldn't
be able to initialize the damn things).

If you had something else in mind, please let me know.

~kj



More information about the Python-list mailing list