◐ Shell
clean mode source ↗

gh-145056: Fix merging of OrderedDict and UserDict with frozendict by serhiy-storchaka · Pull Request #146295 · python/cpython

Expand Up @@ -328,14 +328,14 @@ def __ior__(self, other): return self
def __or__(self, other): if not isinstance(other, dict): if not isinstance(other, (dict, frozendict)): return NotImplemented new = self.__class__(self) new.update(other) return new
def __ror__(self, other): if not isinstance(other, dict): if not isinstance(other, (dict, frozendict)): return NotImplemented new = self.__class__(other) new.update(self) Expand Down Expand Up @@ -1216,14 +1216,14 @@ def __repr__(self): def __or__(self, other): if isinstance(other, UserDict): return self.__class__(self.data | other.data) if isinstance(other, dict): if isinstance(other, (dict, frozendict)): return self.__class__(self.data | other) return NotImplemented
def __ror__(self, other): if isinstance(other, UserDict): return self.__class__(other.data | self.data) if isinstance(other, dict): if isinstance(other, (dict, frozendict)): return self.__class__(other | self.data) return NotImplemented
Expand Down