diff options
author | Stephan Hoyer <shoyer@google.com> | 2017-04-30 21:33:21 -0700 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2017-04-30 21:33:21 -0700 |
commit | e799be5f6a1bb2e0a294a1b0f03a1dc5333f529b (patch) | |
tree | 0224b8f626ff85a51b25cc2f2ce1a7fdb9086595 /numpy/lib/mixins.py | |
parent | 8db9662a3352ab029a5bbc2d81e5363d7a388e2e (diff) | |
download | numpy-e799be5f6a1bb2e0a294a1b0f03a1dc5333f529b.tar.gz |
ENH: add __pos__ to NDArrayOperatorsMixin
Diffstat (limited to 'numpy/lib/mixins.py')
-rw-r--r-- | numpy/lib/mixins.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/lib/mixins.py b/numpy/lib/mixins.py index b5231e372..bbeed1437 100644 --- a/numpy/lib/mixins.py +++ b/numpy/lib/mixins.py @@ -70,8 +70,8 @@ class NDArrayOperatorsMixin(object): implement. This class does not yet implement the special operators corresponding - to ``divmod``, unary ``+`` or ``matmul`` (``@``), because these operation - do not yet have corresponding NumPy ufuncs. + to ``divmod`` or ``matmul`` (``@``), because these operation do not yet + have corresponding NumPy ufuncs. It is useful for writing classes that do not inherit from `numpy.ndarray`, but that should support arithmetic and numpy universal functions like @@ -174,5 +174,6 @@ class NDArrayOperatorsMixin(object): # unary methods __neg__ = _unary_method(um.negative, 'neg') + __pos__ = _unary_method(um.positive, 'pos') __abs__ = _unary_method(um.absolute, 'abs') __invert__ = _unary_method(um.invert, 'invert') |