diff --git a/stubs/cachetools/cachetools/__init__.pyi b/stubs/cachetools/cachetools/__init__.pyi index fa9915f97..f1e5acc92 100644 --- a/stubs/cachetools/cachetools/__init__.pyi +++ b/stubs/cachetools/cachetools/__init__.pyi @@ -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 diff --git a/stubs/protobuf/@tests/stubtest_allowlist.txt b/stubs/protobuf/@tests/stubtest_allowlist.txt index a535e4b41..2c5e07c85 100644 --- a/stubs/protobuf/@tests/stubtest_allowlist.txt +++ b/stubs/protobuf/@tests/stubtest_allowlist.txt @@ -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__