diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-09-04 07:12:31 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-09-04 07:12:31 -0700 |
commit | 573b3b0215294a881e3504cec8818ee194679342 (patch) | |
tree | 43481412895b62b42c32f50d3d7e3c33d3678eae | |
parent | 0a91ade9e89bde3163ad9035556b912dfc90db16 (diff) | |
parent | e2675e3ac08f2fb3a7e606123ad063e7e956cb9d (diff) | |
download | numpy-573b3b0215294a881e3504cec8818ee194679342.tar.gz |
Merge pull request #3657 from charris/add-hash-method-to-polynomials
BUG: Set __hash__ = None for non-hashable classes.
-rw-r--r-- | numpy/lib/polynomial.py | 2 | ||||
-rw-r--r-- | numpy/polynomial/polytemplate.py | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 49b6b0a0b..8545375cd 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -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(): diff --git a/numpy/polynomial/polytemplate.py b/numpy/polynomial/polytemplate.py index 0505ba5f0..f315915d6 100644 --- a/numpy/polynomial/polytemplate.py +++ b/numpy/polynomial/polytemplate.py @@ -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. |