def __hash__(self) -> int: """The hash of this bidict as determined by its items.""" if getattr(self, '_hash', None) is None: # The following is like hash(frozenset(self.items())) # but more memory efficient. See also: https://bugs.python.org/issue46684 self._hash = t.ItemsView(self)._hash() # type: ignore [attr-defined] # https://github.com/python/typeshed/pull/7153 return self._hash
def __hash__(self) -> int: """The hash of this bidict as determined by its items.""" if getattr(self, '_hash', None) is None: self._hash = _t.ItemsView(self)._hash() # type: ignore return self._hash # type: ignore