Skip to content

Commit ee07b91

Browse files
committed
really it should just drop none
1 parent fae5f60 commit ee07b91

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/dfn2toml.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ def _attach_children(d: Any):
2424
return d
2525

2626
@staticmethod
27-
def _drop_empty(d: Any):
27+
def _drop_none(d: Any):
2828
if isinstance(d, Mapping):
2929
return {
30-
k: Shim._drop_empty(v)
30+
k: Shim._drop_none(v)
3131
for k, v in d.items()
32-
if (v or isinstance(v, bool))
32+
if v is not None
3333
}
3434
else:
3535
return d
@@ -43,7 +43,7 @@ def _trim(d: dict) -> dict:
4343

4444
@staticmethod
4545
def apply(d: dict) -> dict:
46-
return Shim._attach_children(Shim._drop_empty(Shim._trim(d)))
46+
return Shim._attach_children(Shim._drop_none(Shim._trim(d)))
4747

4848

4949
if __name__ == "__main__":

0 commit comments

Comments
 (0)