Skip to content

Commit a318d58

Browse files
Use or instead of many if
1 parent 0019733 commit a318d58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/zarr/core/dtype/npy/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ def check_json_float_v2(data: JSON) -> TypeGuard[JSONFloatV2]:
384384
Bool
385385
True if the data is a float, False otherwise.
386386
"""
387-
if data == "NaN" or data == "Infinity" or data == "-Infinity":
388-
return True
389-
return isinstance(data, float | int)
387+
return (
388+
data == "NaN" or data == "Infinity" or data == "-Infinity" or isinstance(data, float | int)
389+
)
390390

391391

392392
def check_json_float_v3(data: JSON) -> TypeGuard[JSONFloatV3]:

0 commit comments

Comments
 (0)