Implement a unary special method with a ufunc.
(ufunc, name)
| 49 | |
| 50 | |
| 51 | def _unary_method(ufunc, name): |
| 52 | """Implement a unary special method with a ufunc.""" |
| 53 | def func(self): |
| 54 | return ufunc(self) |
| 55 | func.__name__ = '__{}__'.format(name) |
| 56 | return func |
| 57 | |
| 58 | |
| 59 | class NDArrayOperatorsMixin: |
no outgoing calls
no test coverage detected