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]],
)
| 2203 | |
| 2204 | |
| 2205 | def _merge_mappings( |
| 2206 | obj1: Mapping[_T_co, Union[_T, Omit]], |
| 2207 | obj2: Mapping[_T_co, Union[_T, Omit]], |
| 2208 | ) -> Dict[_T_co, _T]: |
| 2209 | """Merge two mappings of the same type, removing any values that are instances of `Omit`. |
| 2210 | |
| 2211 | In cases with duplicate keys the second mapping takes precedence. |
| 2212 | """ |
| 2213 | merged = {**obj1, **obj2} |
| 2214 | return {key: value for key, value in merged.items() if not isinstance(value, Omit)} |
no test coverage detected