[Numpy-svn] [numpy/numpy] 631f9e: BUG: Set __hash__ = None for non-hashable classes.

GitHub noreply@github....
Wed Sep 4 10:01:41 CDT 2013


  Branch: refs/heads/maintenance/1.8.x
  Home:   https://github.com/numpy/numpy
  Commit: 631f9ede0b23f3b7379a19a898da00895893d858
      https://github.com/numpy/numpy/commit/631f9ede0b23f3b7379a19a898da00895893d858
  Author: Charles Harris <charlesr.harris@gmail.com>
  Date:   2013-09-04 (Wed, 04 Sep 2013)

  Changed paths:
    M numpy/lib/polynomial.py
    M numpy/polynomial/polytemplate.py

  Log Message:
  -----------
  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.


  Commit: 49c22d3f0d98e4a98d846910e087acf818b92d48
      https://github.com/numpy/numpy/commit/49c22d3f0d98e4a98d846910e087acf818b92d48
  Author: Charles Harris <charlesr.harris@gmail.com>
  Date:   2013-09-04 (Wed, 04 Sep 2013)

  Changed paths:
    M numpy/lib/polynomial.py
    M numpy/polynomial/polytemplate.py

  Log Message:
  -----------
  Merge pull request #3684 from charris/backport-to-1.8-3657

Backport to 1.8 3657


Compare: https://github.com/numpy/numpy/compare/0fdcaea83e3b...49c22d3f0d98


More information about the Numpy-svn mailing list