未验证 提交 6586bca9 编写于 作者: P pukkandan

[utils] Fix LazyList for Falsey values

上级 da503b7a
......@@ -6287,8 +6287,8 @@ def _traverse_obj(obj, path, _current_depth=0):
if val is not None:
if depth:
for _ in range(depth - 1):
val = itertools.chain.from_iterable(filter(None, val))
val = (list(filter(None, val)) if expected_type is None
val = itertools.chain.from_iterable(v for v in val if v is not None)
val = ([v for v in val if v is not None] if expected_type is None
else [v for v in val if isinstance(v, expected_type)])
if val:
return val
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册