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

Function _unary_method

numpy/lib/mixins.py:51–56  ·  view source on GitHub ↗

Implement a unary special method with a ufunc.

(ufunc, name)

Source from the content-addressed store, hash-verified

49
50
51def _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
59class NDArrayOperatorsMixin:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected