Skip to content

treex.Named

Named(args, *kwds)

Source code in treex/types.py
class Named(tp.Generic[A]):
    name: str
    value: A

    def tree_flatten(self):
        return (self.value,), self.name

    @classmethod
    def tree_unflatten(cls, name, children):
        return cls(name, children[0])