Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix instancemethods
  • Loading branch information
asvetlov authored and jakkdl committed Jul 31, 2023
commit f612ee8dcb8b50775dd67c00e722165c6310ae74
15 changes: 14 additions & 1 deletion stdlib/functools.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import types
from _typeshed import SupportsAllComparisons, SupportsItems
from collections.abc import Callable, Hashable, Iterable, Sequence, Sized
from typing import Any, Generic, NamedTuple, TypeVar, overload
from typing_extensions import Literal, ParamSpec, Self, TypeAlias, TypedDict, final
from typing_extensions import Concatenate, Literal, ParamSpec, Self, TypeAlias, TypedDict, final

if sys.version_info >= (3, 9):
from types import GenericAlias
Expand Down Expand Up @@ -64,6 +64,19 @@ class _lru_cache_wrapper(Generic[_P, _T]):

def __copy__(self) -> _lru_cache_wrapper[_P, _T]: ...
def __deepcopy__(self, __memo: Any) -> _lru_cache_wrapper[_P, _T]: ...
@overload
def __get__(self, instance: _S, owner: type[_S]) -> _lru_cache_wrapper_instance[_S, _P, _T]: ...
@overload
def __get__(self, instance: _S, owner: None) -> _lru_cache_wrapper[_P, _T]: ...

@final
class _lru_cache_wrapper_instance(Generic[_S, _P, _T]):
__wrapped__: Callable[Concatenate[_S, _P], _T]
def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
def cache_info(self) -> _CacheInfo: ...
def cache_clear(self) -> None: ...
def __copy__(self) -> _lru_cache_wrapper[Concatenate[_S, _P], _T]: ...
def __deepcopy__(self, __memo: Any) -> _lru_cache_wrapper[Concatenate[_S, _P], _T]: ...

if sys.version_info >= (3, 8):
@overload
Expand Down