Skip to content

Commit 89a85a6

Browse files
authored
Merge branch 'main' into vecdot-conj
2 parents 07043a0 + 382bbac commit 89a85a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

array_api_compat/common/_helpers.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,7 @@ def your_function(x, y):
492492

493493
namespaces = set()
494494
for x in xs:
495-
if isinstance(x, (bool, int, float, complex, type(None))):
496-
continue
497-
elif is_numpy_array(x):
495+
if is_numpy_array(x):
498496
from .. import numpy as numpy_namespace
499497
import numpy as np
500498
if use_compat is True:
@@ -558,6 +556,8 @@ def your_function(x, y):
558556
if use_compat is True:
559557
raise ValueError("The given array does not have an array-api-compat wrapper")
560558
namespaces.add(x.__array_namespace__(api_version=api_version))
559+
elif isinstance(x, (bool, int, float, complex, type(None))):
560+
continue
561561
else:
562562
# TODO: Support Python scalars?
563563
raise TypeError(f"{type(x).__name__} is not a supported array type")

0 commit comments

Comments
 (0)