Skip to content

Commit 6653644

Browse files
committed
Handle __int__ and __invert__ as non-inplace operators
1 parent 4910b34 commit 6653644

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

array_api_tests/test_signatures.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ def test_function_positional_args(name):
110110
# written in pure Python (e.g., it won't work for numpy ufuncs).
111111

112112
dtype = None
113-
if name.startswith('__i') or name.startswith('__r') and name != '__rshift__':
113+
if (name.startswith('__i') and name not in ['__int__', '__invert__']
114+
or name.startswith('__r') and name != '__rshift__'):
114115
n = operators_to_functions[name[:2] + name[3:]]
115116
else:
116117
n = operators_to_functions.get(name, name)

0 commit comments

Comments
 (0)