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]],
)
| 1984 | |
| 1985 | |
| 1986 | def _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)} |
no outgoing calls
no test coverage detected