flex_model.traverse.InternalNode

class flex_model.traverse.InternalNode(children: List[InternalNode | LeafNode | Any] | None = None)

Node correponding to unpackable container. These are nodes which we can always unpack other python objects from to continue traversal.

Variables:

children – A list of children nodes.

__init__(children: List[InternalNode | LeafNode | Any] | None = None) None

Methods

__init__([children])

flatten(instance)

Flatten the associated instance by returning its contents.

unflatten(children)

Pack the contents (children) back into the associated container.