Skip to content

treeo.field

Source code in treeo/utils.py
def field(
    default: tp.Any = dataclasses.MISSING,
    *,
    node: bool,
    kind: type = type(None),
    default_factory: tp.Any = dataclasses.MISSING,
    init: bool = True,
    repr: bool = True,
    hash: tp.Optional[bool] = None,
    compare: bool = True,
) -> tp.Any:

    return dataclasses.field(
        default=default,
        metadata={
            "node": node,
            "kind": kind,
        },
        default_factory=default_factory,
        init=init,
        repr=repr,
        hash=hash,
        compare=compare,
    )