We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be3283b commit fae5f60Copy full SHA for fae5f60
spec/dfn2toml.py
@@ -24,12 +24,12 @@ def _attach_children(d: Any):
24
return d
25
26
@staticmethod
27
- def _drop_none(d: Any):
+ def _drop_empty(d: Any):
28
if isinstance(d, Mapping):
29
return {
30
- k: Shim._drop_none(v)
+ k: Shim._drop_empty(v)
31
for k, v in d.items()
32
- if v is not None
+ if (v or isinstance(v, bool))
33
}
34
else:
35
@@ -43,7 +43,7 @@ def _trim(d: dict) -> dict:
43
44
45
def apply(d: dict) -> dict:
46
- return Shim._attach_children(Shim._drop_none(Shim._trim(d)))
+ return Shim._attach_children(Shim._drop_empty(Shim._trim(d)))
47
48
49
if __name__ == "__main__":
0 commit comments