[Numpy-svn] [numpy/numpy] fd5d30: BUG: core: ensure __r*__ has precedence over __num...

GitHub noreply at github.com
Sat Oct 19 17:24:30 EDT 2013


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: fd5d3088ed71bbc2fe5a774178be5e0ba04e4cd1
      https://github.com/numpy/numpy/commit/fd5d3088ed71bbc2fe5a774178be5e0ba04e4cd1
  Author: Pauli Virtanen <pav at iki.fi>
  Date:   2013-10-19 (Sat, 19 Oct 2013)

  Changed paths:
    M doc/neps/ufunc-overrides.rst
    M doc/source/reference/arrays.classes.rst
    M numpy/core/src/multiarray/arrayobject.c
    M numpy/core/src/multiarray/number.c
    M numpy/core/src/multiarray/number.h
    M numpy/core/tests/test_multiarray.py

  Log Message:
  -----------
  BUG: core: ensure __r*__ has precedence over __numpy_ufunc__

Add a special case to the implementation of ndarray.__mul__ et al. that
refuses to work on other objects that are not ndarray subclasses and
implement both __numpy_ufunc__ and __r*__.

This way, execution passes first to the custom __r*__ method, which
makes it possible to have e.g. __mul__ and np.multiply do different
things.

Additionally, disable one __array_priority__ special case handling when
also __numpy_ufunc__ is defined.


  Commit: 55d3ef5b81b709cc9d8ad6b13f75ca0f05f65276
      https://github.com/numpy/numpy/commit/55d3ef5b81b709cc9d8ad6b13f75ca0f05f65276
  Author: Charles Harris <charlesr.harris at gmail.com>
  Date:   2013-10-19 (Sat, 19 Oct 2013)

  Changed paths:
    M doc/neps/ufunc-overrides.rst
    M doc/source/reference/arrays.classes.rst
    M numpy/core/src/multiarray/arrayobject.c
    M numpy/core/src/multiarray/number.c
    M numpy/core/src/multiarray/number.h
    M numpy/core/tests/test_multiarray.py

  Log Message:
  -----------
  Merge pull request #3856 from pv/op-before-ufunc

BUG: core: ensure __r*__ has precedence over __numpy_ufunc__


Compare: https://github.com/numpy/numpy/compare/1eb5f03c4c27...55d3ef5b81b7


More information about the Numpy-svn mailing list