We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 866cedb commit cfb8e54Copy full SHA for cfb8e54
array_api_strict/_helpers.py
@@ -2,11 +2,20 @@
2
"""
3
import numpy as np
4
5
+from ._flags import get_array_api_strict_flags
6
+
7
8
_py_scalars = (bool, int, float, complex)
9
10
11
def _maybe_normalize_py_scalars(x1, x2):
12
from ._array_object import Array
13
14
+ flags = get_array_api_strict_flags()
15
+ if flags["array_api"] < "2024.12":
16
+ # XXX: string comparison for versions
17
+ return x1, x2
18
19
if isinstance(x1, _py_scalars):
20
if isinstance(x2, _py_scalars):
21
raise TypeError(f"Two scalars not allowed, {type(x1) = } and {type(x2) =}")
0 commit comments