Skip to content

Commit b67865f

Browse files
Update src/array_api_extra/_lib/_utils/_helpers.py
Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
1 parent 36a422f commit b67865f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/array_api_extra/_lib/_utils/_helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def is_python_scalar(x: object) -> TypeIs[complex]: # numpydoc ignore=PR01,RT01
105105
"""Return True if `x` is a Python scalar, False otherwise."""
106106
# isinstance(x, float) returns True for np.float64
107107
# isinstance(x, complex) returns True for np.complex128
108+
# bool is a subclass of int
108109
return isinstance(x, int | float | complex) and not is_numpy_array(x)
109110

110111

0 commit comments

Comments
 (0)