If you google around you can find a frozendict class that is immutable and
hashable.

Alternatively there is also a SymPy Dict class.

On Thu, Apr 26, 2012 at 4:04 PM, [email protected] <
[email protected]> wrote:

> There is an easy way to check for yourself that the dict build-in does
> not have a hash method:
>
> In [1]: d = {1:1}
> In [2]: hash(d)
> TypeError: unhashable type: 'dict'
>
> Hashes are not defined on mutable objects because the hash of an
> object should not change. Thanks to this quality hashes can be used
> for cashing.
>
> Cashing and hashes are an important part of the core, this is why for
> the moment if you implement something in sympy it should be immutable.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to