From f75568ad48ef4a08ea3a5d033018b97c9123614f Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Mon, 9 Feb 2026 17:43:58 +0100 Subject: [PATCH] BUG: clip: allow clip(float_array, min=int_scalar) Python integers can be promoted together with float arrays. --- array_api_strict/_elementwise_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/array_api_strict/_elementwise_functions.py b/array_api_strict/_elementwise_functions.py index 10c854e..791959a 100644 --- a/array_api_strict/_elementwise_functions.py +++ b/array_api_strict/_elementwise_functions.py @@ -278,7 +278,7 @@ def clip( isinstance(arg, Array) and arg.dtype in _real_floating_dtypes)): raise TypeError(f"{argname} must be integral when x is integral") if (x.dtype in _real_floating_dtypes - and (isinstance(arg, int) or + and (#isinstance(arg, int) or isinstance(arg, Array) and arg.dtype in _integer_dtypes)): raise TypeError(f"{arg} must be floating-point when x is floating-point")