core.deepmerge#
Deep Merge.
Inspired by toumorokoshi/deepmerge. See “Credit” section of the polyconf README.
Module Contents#
Classes#
A function that merges two sources. |
|
Deep Merge. |
Functions#
For keys that do not exist, use them directly. If the key exists in both dictionaries, attempt a value merge. |
Data#
API#
- class core.deepmerge.Strategy#
Bases:
typing.ProtocolA function that merges two sources.
- __call__(merger: core.deepmerge.Merger, path: list[str], base: dict[str, Any], other: dict[str, Any]) dict[str, Any]#
- core.deepmerge.dict_strategy_merge(merger: Merger, path: list[str], base: dict[str, Any], other: dict[str, Any]) dict[str, Any]#
For keys that do not exist, use them directly. If the key exists in both dictionaries, attempt a value merge.
- core.deepmerge.strategy_map: dict[type, core.deepmerge.Strategy] = None#
- class core.deepmerge.Merger#
Deep Merge.
- merge(base: dict[str, Any], other: dict[str, Any]) dict[str, Any]#
Merge two dictionaries.
- value_strategy(path: list[str], base: dict[str, Any], other: dict[str, Any]) dict[str, Any]#
Merge two values.
- core.deepmerge.deep = None#