Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
// | |
// --------- Model --------- | |
// | |
type Details = | |
{ Name: string | |
Description: string } | |
type Item = | |
{ Details: Details } |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!