Implement a reflected binary method with a ufunc, e.g., __radd__.
(ufunc, name)
| 24 | |
| 25 | |
| 26 | def _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 | |
| 36 | def _inplace_binary_method(ufunc, name): |
no outgoing calls
no test coverage detected