Skip to content

Commit 53dc76e

Browse files
committed
Use len to improve readability
1 parent 1f9eb68 commit 53dc76e

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
@@ -2992,7 +2992,7 @@ def isel(
29922992
dims.update(zip(var.dims, var.shape))
29932993
# Fastpath, skip all of this for variables with no dimensions
29942994
# Keep the result cached for future dictionary update
2995-
elif var_dims := var.dims:
2995+
elif len(var_dims := var.dims):
29962996
# Large datasets with alot of metadata may have many scalars
29972997
# without any relevant dimensions for slicing.
29982998
# Pick those out quickly and avoid paying the cost below

0 commit comments

Comments
 (0)