diff --git a/stdlib/3/functools.pyi b/stdlib/3/functools.pyi index 78a3466eaa45..a23ef6f5f8e0 100644 --- a/stdlib/3/functools.pyi +++ b/stdlib/3/functools.pyi @@ -76,3 +76,14 @@ class _SingleDispatchCallable(Generic[_T]): def __call__(self, *args: Any, **kwargs: Any) -> _T: ... def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... + +if sys.version_info >= (3, 8): + class cached_property(Generic[_S, _T]): + func: Callable[[_S], _T] + attrname: Optional[str] + def __init__(self, func: Callable[[_S], _T]) -> None: ... + @overload + def __get__(self, instance: None, owner: Optional[Type[_S]] = ...) -> cached_property[_S, _T]: ... + @overload + def __get__(self, instance: _S, owner: Optional[Type[_S]] = ...) -> _T: ... + def __set_name__(self, owner: Type[_S], name: str) -> None: ...