Skip to content

Commit dc3f5d9

Browse files
authored
Simplify condition
1 parent 4ee28b8 commit dc3f5d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpath/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def get(
167167
If more than one leaf matches the glob, ValueError is raised. If the glob is
168168
not found and a default is not provided, KeyError is raised.
169169
"""
170-
if glob == "/" or (type(glob) is not str and len(glob) == 0):
170+
if isinstance(glob, str) and glob == "/" or len(glob) == 0:
171171
return obj
172172

173173
globlist = _split_path(glob, separator)

0 commit comments

Comments
 (0)