Skip to content

Commit 081d700

Browse files
committed
Warn on awkward inferred default dtypes
1 parent 00f63bb commit 081d700

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

array_api_tests/dtype_helpers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ class MinMax(NamedTuple):
124124
)
125125
else:
126126
default_int = xp.asarray(int()).dtype
127+
if default_int not in int_dtypes:
128+
warn(f"inferred default int is {default_int!r}, which is not an int")
127129
default_float = xp.asarray(float()).dtype
130+
if default_float not in float_dtypes:
131+
warn(f"inferred default float is {default_float!r}, which is not a float")
128132
if dtype_nbits[default_int] == 32:
129133
default_uint = xp.uint32
130134
else:

0 commit comments

Comments
 (0)