MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / _merge_mappings

Function _merge_mappings

src/opencode_ai/_base_client.py:1986–1995  ·  view source on GitHub ↗

Merge two mappings of the same type, removing any values that are instances of `Omit`. In cases with duplicate keys the second mapping takes precedence.

(
    obj1: Mapping[_T_co, Union[_T, Omit]],
    obj2: Mapping[_T_co, Union[_T, Omit]],
)

Source from the content-addressed store, hash-verified

1984
1985
1986def _merge_mappings(
1987 obj1: Mapping[_T_co, Union[_T, Omit]],
1988 obj2: Mapping[_T_co, Union[_T, Omit]],
1989) -> Dict[_T_co, _T]:
1990 """Merge two mappings of the same type, removing any values that are instances of `Omit`.
1991
1992 In cases with duplicate keys the second mapping takes precedence.
1993 """
1994 merged = {**obj1, **obj2}
1995 return {key: value for key, value in merged.items() if not isinstance(value, Omit)}

Callers 2

_build_headersMethod · 0.85
_build_requestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected