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

Function _binary_method

numpy/lib/mixins.py:16–23  ·  view source on GitHub ↗

Implement a forward binary method with a ufunc, e.g., __add__.

(ufunc, name)

Source from the content-addressed store, hash-verified

14
15
16def _binary_method(ufunc, name):
17 """Implement a forward binary method with a ufunc, e.g., __add__."""
18 def func(self, other):
19 if _disables_array_ufunc(other):
20 return NotImplemented
21 return ufunc(self, other)
22 func.__name__ = '__{}__'.format(name)
23 return func
24
25
26def _reflected_binary_method(ufunc, name):

Callers 2

_numeric_methodsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected