mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
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:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user