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

Method _delegate_binop

numpy/ma/core.py:4083–4095  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

4081 return prefix + result + ')'
4082
4083 def _delegate_binop(self, other):
4084 # This emulates the logic in
4085 # private/binop_override.h:forward_binop_should_defer
4086 if isinstance(other, type(self)):
4087 return False
4088 array_ufunc = getattr(other, "__array_ufunc__", False)
4089 if array_ufunc is False:
4090 other_priority = getattr(other, "__array_priority__", -1000000)
4091 return self.__array_priority__ < other_priority
4092 else:
4093 # If array_ufunc is not None, it will be called inside the ufunc;
4094 # None explicitly tells us to not call the ufunc, i.e., defer.
4095 return array_ufunc is None
4096
4097 def _comparison(self, other, compare):
4098 """Compare self with other using operator.eq or operator.ne.

Callers 7

__add__Method · 0.95
__sub__Method · 0.95
__mul__Method · 0.95
__div__Method · 0.95
__truediv__Method · 0.95
__floordiv__Method · 0.95
__pow__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected