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

GitHub noreply@github....
Wed Sep 4 09:12:32 CDT 2013


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: e2675e3ac08f2fb3a7e606123ad063e7e956cb9d
      https://github.com/numpy/numpy/commit/e2675e3ac08f2fb3a7e606123ad063e7e956cb9d
  Author: Charles Harris <charlesr.harris@gmail.com>
  Date:   2013-08-28 (Wed, 28 Aug 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: 573b3b0215294a881e3504cec8818ee194679342
      https://github.com/numpy/numpy/commit/573b3b0215294a881e3504cec8818ee194679342
  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 #3657 from charris/add-hash-method-to-polynomials

BUG: Set __hash__ = None for non-hashable classes.


Compare: https://github.com/numpy/numpy/compare/0a91ade9e89b...573b3b021529


More information about the Numpy-svn mailing list