projects
/
linpy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
2883555
)
Fix Expression.__hash__
author
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Thu, 19 Jun 2014 07:15:55 +0000
(09:15 +0200)
committer
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Thu, 19 Jun 2014 07:15:55 +0000
(09:15 +0200)
pypol/linear.py
patch
|
blob
|
history
diff --git
a/pypol/linear.py
b/pypol/linear.py
index
8f73fd3
..
2c71c02
100644
(file)
--- a/
pypol/linear.py
+++ b/
pypol/linear.py
@@
-271,7
+271,7
@@
class Expression:
self.constant == other.constant
def __hash__(self):
- return hash((
self._coefficients
, self._constant))
+ return hash((
tuple(sorted(self._coefficients.items()))
, self._constant))
def _toint(self):
lcm = functools.reduce(lambda a, b: a*b // gcd(a, b),