Permalink
Browse files

Merge pull request #3657 from charris/add-hash-method-to-polynomials

BUG: Set __hash__ = None for non-hashable classes.
  • Loading branch information...
charris committed Sep 4, 2013
2 parents 0a91ade + e2675e3 commit 573b3b0215294a881e3504cec8818ee194679342
Showing with 4 additions and 0 deletions.
  1. +2 −0 numpy/lib/polynomial.py
  2. +2 −0 numpy/polynomial/polytemplate.py
View
@@ -1030,6 +1030,8 @@ class poly1d(object):
coeffs = None
order = None
variable = None
+ __hash__ = None
+
def __init__(self, c_or_r, r=0, variable=None):
if isinstance(c_or_r, poly1d):
for key in c_or_r.__dict__.keys():
@@ -79,6 +79,8 @@ class $name(pu.PolyBase) :
window = np.array($domain)
# Don't let participate in array operations. Value doesn't matter.
__array_priority__ = 1000
+ # Not hashable
+ __hash__ = None
def has_samecoef(self, other):
"""Check if coefficients match.

0 comments on commit 573b3b0

Please sign in to comment.