MCPcopy Index your code
hub / github.com/numpy/numpy / _delegate_binop

Method _delegate_binop

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

Source from the content-addressed store, hash-verified

4177 return prefix + result + ')'
4178
4179 def _delegate_binop(self, other):
4180 # This emulates the logic in
4181 # private/binop_override.h:forward_binop_should_defer
4182 if isinstance(other, type(self)):
4183 return False
4184 array_ufunc = getattr(other, "__array_ufunc__", False)
4185 if array_ufunc is False:
4186 other_priority = getattr(other, "__array_priority__", -1000000)
4187 return self.__array_priority__ < other_priority
4188 else:
4189 # If array_ufunc is not None, it will be called inside the ufunc;
4190 # None explicitly tells us to not call the ufunc, i.e., defer.
4191 return array_ufunc is None
4192
4193 def _comparison(self, other, compare):
4194 """Compare self with other using operator.eq or operator.ne.

Callers 6

__add__Method · 0.95
__sub__Method · 0.95
__mul__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