Skip to content

Commit 9465959

Browse files
committed
Add __contains__ to MinMax
1 parent c9bdcf1 commit 9465959

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

array_api_tests/dtype_helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ class MinMax(NamedTuple):
209209
min: Union[int, float]
210210
max: Union[int, float]
211211

212+
def __contains__(self, other):
213+
assert isinstance(other, (int, float))
214+
return self.min <= other <= self.max
212215

213216
dtype_ranges = _make_dtype_mapping_from_names(
214217
{

0 commit comments

Comments
 (0)