New issue 225 by damien.d...@gmail.com: Equal intervals have different
hashes
http://code.google.com/p/mpmath/issues/detail?id=225
The current hash() implementation for mpi instances does not return
identical hashes for equal objects:
>>> import mpmath
>>> a = mpmath.mpi(10, 30)
>>> b = mpmath.mpi(10, 30)
>>> a == b
True
>>> hash(a) == hash(b)
False
Since intervals are immutable (correct me if I'm wrong), it would be nice
to have equal hashes for equal objects, especially for use in sets and
dicts.
mpmath: SVN (> 0.17)
python2.7
Thanks for the bug report.
I pushed a fix here:
https://github.com/fredrik-johansson/mpmath/commit/61b9a7a68d31bd0f004290f9d24fdc372b424eb7