From 31c195aacf2a7c4116678590cacaffe974add5c8 Mon Sep 17 00:00:00 2001 From: Alan Du Date: Fri, 30 Jan 2026 07:38:59 -0500 Subject: [PATCH] [functools] Add __name__/__qualname__ to _lru_cache_wrapper (#15328) --- stdlib/functools.pyi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 52d0d0958..57bc3f179 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -63,6 +63,10 @@ class _lru_cache_wrapper(Generic[_T_co]): def __copy__(self) -> _lru_cache_wrapper[_T_co]: ... def __deepcopy__(self, memo: Any, /) -> _lru_cache_wrapper[_T_co]: ... + # as with ``Callable``, we'll assume that these attributes exist + __name__: str + __qualname__: str + @overload def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... @overload