-
-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Discussed in #382
Originally posted by martinius74 February 26, 2024
I was trying to clean my nested dictionaries from any empty string and collections, but somehow, it only considers the root level.
Nested keys are not cleaned.
Looking into the code, the method is using the keys() method.
def clean(d, strings=True, collections=True):
keys = list(d.keys())
If we would use the keypaths() method, it would be able to find all nested keys as well:
def clean(d, strings=True, collections=True):
keys = d.keypaths()
Would it make sense to change this behaviour?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Projects
Status
Done