Skip to content

Commit fadd876

Browse files
committed
Use len to improve readability
1 parent 2592076 commit fadd876

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xarray/core/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2990,7 +2990,7 @@ def isel(
29902990
dims.update(zip(var.dims, var.shape))
29912991
# Fastpath, skip all of this for variables with no dimensions
29922992
# Keep the result cached for future dictionary update
2993-
elif var_dims := var.dims:
2993+
elif len(var_dims := var.dims):
29942994
# Large datasets with alot of metadata may have many scalars
29952995
# without any relevant dimensions for slicing.
29962996
# Pick those out quickly and avoid paying the cost below

0 commit comments

Comments
 (0)