Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LLN:
- def __init__(self, val=None, *subnodes):
- self._subnodes = list(subnodes)
- self.val = val
- def append(val):
- subnode = LLN(val)
- self._subnodes.append(subnode)
- return subnode
- def get():
- """depth-first recursive get"""
- ret = []
- for val in self.val:
- if isinstance(val, LLN):
- ret.extend(val.getDF())
- else:
- ret.append(val)
- return ret
Add Comment
Please, Sign In to add comment