Best practice for caching hash

Marco Sulla Marco.Sulla.Python at gmail.com
Wed Mar 16 14:21:07 EDT 2022


On Wed, 16 Mar 2022 at 00:59, Chris Angelico <rosuav at gmail.com> wrote:
>
> (Though it's a little confusing; a frozendict has to have nothing but
> immutable objects, yet it permits them to be unhashable?

It can have mutable objects. For example, a key k can have a list v as
value. You can modify v, but you can't assign to the key k another
value w. It's the same with the tuples, as you said. An index i can
contain a list l. Since it's a tuple, you can't set another object at
the index i, but you can modify the list l.


More information about the Python-list mailing list