Fix return type of protobuf.ScalarMap.get() (#9996)

This commit is contained in:
spatinom
2023-04-03 05:50:34 -04:00
committed by GitHub
parent 88a9e900b6
commit f828ce63e8

View File

@@ -67,7 +67,7 @@ class ScalarMap(MutableMapping[_K, _ScalarV]):
def __iter__(self) -> Iterator[_K]: ...
def __eq__(self, other: object) -> bool: ...
@overload
def get(self, key: _K, default: None = ...) -> _ScalarV: ...
def get(self, key: _K, default: None = ...) -> _ScalarV | None: ...
@overload
def get(self, key: _K, default: _ScalarV | _T) -> _ScalarV | _T: ...
def MergeFrom(self: _M, other: _M): ...
@@ -89,7 +89,7 @@ class MessageMap(MutableMapping[_K, _MessageV]):
def __iter__(self) -> Iterator[_K]: ...
def __eq__(self, other: object) -> bool: ...
@overload
def get(self, key: _K, default: None = ...) -> _MessageV: ...
def get(self, key: _K, default: None = ...) -> _MessageV | None: ...
@overload
def get(self, key: _K, default: _MessageV | _T) -> _MessageV | _T: ...
def get_or_create(self, key: _K) -> _MessageV: ...