MCPcopy Create free account
hub / github.com/numpy/numpy / _reflected_binary_method

Function _reflected_binary_method

numpy/lib/mixins.py:26–33  ·  view source on GitHub ↗

Implement a reflected binary method with a ufunc, e.g., __radd__.

(ufunc, name)

Source from the content-addressed store, hash-verified

24
25
26def _reflected_binary_method(ufunc, name):
27 """Implement a reflected binary method with a ufunc, e.g., __radd__."""
28 def func(self, other):
29 if _disables_array_ufunc(other):
30 return NotImplemented
31 return ufunc(other, self)
32 func.__name__ = '__r{}__'.format(name)
33 return func
34
35
36def _inplace_binary_method(ufunc, name):

Callers 2

_numeric_methodsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected