Skip to content

models

anymerge.models

ReducerInfo dataclass

ReducerInfo(
    reducer: ReducerCallable | None = None,
    *,
    deep: bool = False,
)

Information about a reducer to apply to a field.

reducer class-attribute instance-attribute

reducer: ReducerCallable | None = None

The reducer callable to apply to the field.

deep class-attribute instance-attribute

deep: bool = field(default=False, kw_only=True)

Whether to apply the reducer deeply.

FieldInfo dataclass

FieldInfo(
    *,
    name: str,
    base_type: type[Any] | list[type[Any]],
    reducers: list[ReducerInfo] | None,
)

Information about a field in a data model.

name instance-attribute

name: str

The name of the field.

base_type instance-attribute

base_type: type[Any] | list[type[Any]]

The base type of the field with annotations removed.

reducers instance-attribute

reducers: list[ReducerInfo] | None

A list of information about reducers to apply to the field.