Closed avihu111 closed 1 year ago
suggested code - without tests/examples/type-hinting:
def top_level_items(self):
return {k: self[k] for k in self.top_level_keys()}
def top_level_values(self):
return [self[k] for k in self.top_level_keys()]
Actually, you can just use:
NDict.flatten()
and then use:
NDict.values()
NDict.items()
NDict API has changed:
NDict.keys()
now returns leaf, not children. Same change goes for.items()
and.values()
.keys()
we have a that only returns the top level (children)-NDict.top_level_keys()
.values()
and.items()
we do not have currently.Can you add the "top_level" functionality for
.items()
and.values()
?Thanks!