8000 MAINT: Remove unused delegate_binop code · numpy/numpy@1bf272f · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 1bf272f

Browse files
committed
MAINT: Remove unused delegate_binop code
This is handled in the C code now within the ufunc machinery.
1 parent e6e80e6 commit 1bf272f

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

numpy/core/src/common/binop_override.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,6 @@ binop_should_defer(PyObject *self, PyObject *other, int inplace)
105105
* logic for forward binop implementations.
106106
*/
107107

108-
/*
109-
* NB: there's another copy of this code in
110-
* numpy.ma.core.MaskedArray._delegate_binop
111-
* which should possibly be updated when this is.
112-
*/
113-
114108
PyObject *attr;
115109
double self_prio, other_prio;
116110
int defer;

numpy/ma/core.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4181,20 +4181,6 @@ def __repr__(self):
41814181
)
41824182
return prefix + result + ')'
41834183

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

0 commit comments

Comments
 (0)
0