Skip to content

Commit 349fd46

Browse files
authored
Merge pull request #186 from ev-br/clip_int_scalars
BUG: clip: allow clip(float_array, min=int_scalar)
2 parents 2ac7511 + f2efce5 commit 349fd46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

array_api_strict/_elementwise_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ def clip(
278278
isinstance(arg, Array) and arg.dtype in _real_floating_dtypes)):
279279
raise TypeError(f"{argname} must be integral when x is integral")
280280
if (x.dtype in _real_floating_dtypes
281-
and (isinstance(arg, int) or
282-
isinstance(arg, Array) and arg.dtype in _integer_dtypes)):
281+
and (isinstance(arg, Array) and arg.dtype in _integer_dtypes)
282+
):
283283
raise TypeError(f"{arg} must be floating-point when x is floating-point")
284284

285285
# Normalize to make the below logic simpler

0 commit comments

Comments
 (0)