Add __eq__ override to ScalarMap and MessageMap of google/protobuf/containers.pyi (#4866)

These classes are defined
https://github.com/protocolbuffers/protobuf/blob/master/python/google/protobuf/internal/containers.py
They actually inherit from a copy-pasta of the Mapping superclass which
includes an __eq__ override, but this is close enough. It prevents
strict equality checks between these and Dicts from failing
This commit is contained in:
Nipunn Koorapati
2020-12-28 12:12:53 +00:00
committed by GitHub
parent 12f0be025f
commit a0cc2f537d

View File

@@ -72,6 +72,7 @@ class ScalarMap(MutableMapping[_K, _V]):
def __getitem__(self, k: _K) -> _V: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_K]: ...
def __eq__(self, other: object) -> bool: ...
def MergeFrom(self: _M, other: _M): ...
def InvalidateIterators(self) -> None: ...
def GetEntryClass(self) -> GeneratedProtocolMessageType: ...
@@ -82,6 +83,7 @@ class MessageMap(MutableMapping[_K, _V]):
def __getitem__(self, k: _K) -> _V: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_K]: ...
def __eq__(self, other: object) -> bool: ...
def get_or_create(self, key: _K) -> _V: ...
def MergeFrom(self: _M, other: _M): ...
def InvalidateIterators(self) -> None: ...