mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 21:01:52 +08:00
Fix MutableMapping overrides (#6352)
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
from _typeshed import IdentityFunction
|
||||
from collections.abc import Iterator, Sequence
|
||||
from typing import Any, Callable, ContextManager, Generic, MutableMapping, TypeVar
|
||||
from typing import Any, Callable, ContextManager, Generic, MutableMapping, TypeVar, overload
|
||||
|
||||
_KT = TypeVar("_KT")
|
||||
_VT = TypeVar("_VT")
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class Cache(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __init__(self, maxsize: float, getsizeof: Callable[[_VT], float] | None = ...) -> None: ...
|
||||
@@ -12,6 +13,11 @@ class Cache(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __delitem__(self, key: _KT) -> None: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload # type: ignore[override]
|
||||
def pop(self, key: _KT) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _VT | _T) -> _VT | _T: ...
|
||||
def setdefault(self, key: _KT, default: _VT | None = ...) -> _VT: ...
|
||||
@property
|
||||
def maxsize(self) -> float: ...
|
||||
@property
|
||||
|
||||
@@ -102,6 +102,10 @@ google.protobuf.internal.containers.BaseContainer.sort
|
||||
google.protobuf.internal.containers.Mapping
|
||||
google.protobuf.internal.containers.MessageMap.__init__
|
||||
google.protobuf.internal.containers.MessageMap.get
|
||||
google.protobuf.internal.containers.MutableMapping.__delitem__
|
||||
google.protobuf.internal.containers.MutableMapping.__setitem__
|
||||
google.protobuf.internal.containers.MutableMapping.pop
|
||||
google.protobuf.internal.containers.MutableMapping.setdefault
|
||||
google.protobuf.internal.containers.RepeatedCompositeFieldContainer.__init__
|
||||
google.protobuf.internal.containers.RepeatedScalarFieldContainer.__init__
|
||||
google.protobuf.internal.containers.ScalarMap.__init__
|
||||
|
||||
Reference in New Issue
Block a user