mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-24 18:48:46 +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
|
||||
|
||||
Reference in New Issue
Block a user