diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-08-28 13:04:59 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-08-28 13:17:40 -0600 |
commit | e2675e3ac08f2fb3a7e606123ad063e7e956cb9d (patch) | |
tree | 45fe9ae83eae02ce0db9c5c1f08748ae1c92e49e /numpy/lib/polynomial.py | |
parent | bec793a28a46fce9a4212e058645f017adfa9f74 (diff) | |
download | numpy-e2675e3ac08f2fb3a7e606123ad063e7e956cb9d.tar.gz |
BUG: Set __hash__ = None for non-hashable classes.
Because neither poly1d nor the Polynomial package polynomial classes are
immutable, hence not reliably hashable, they should signal that by
setting __hash__ = None. This also fixes the warning
Overriding __eq__ blocks inheritance of __hash__ in 3.x
that is given when the command `python2.7 -3 -c"import numpy"` is run.
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r-- | numpy/lib/polynomial.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 48a012c9c..35501b6df 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(): |