Skip to content

treex.add_field_info

A context manager that makes Trees produce leaves as FieldInfo when flattening.

Source code in treeo/api.py
@contextmanager
def add_field_info():
    """
    A context manager that makes `Tree`s produce leaves as `FieldInfo` when flattening.
    """
    with tree_m._CONTEXT.update(add_field_info=True):
        yield