From 0d22fe9429022cf0e24eea3cb7fb3c87f691754b Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 12 Nov 2021 11:33:06 +0000 Subject: [PATCH] Add `__name__`/`__qualname__`/`__wrapped__` to `staticmethod`/`classmethod` These attributes have all been added in Python 3.10+; see https://github.com/python/cpython/pull/25268 --- stdlib/builtins.pyi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 093b564f9683..9100778434ac 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -122,6 +122,9 @@ class staticmethod(object): # Special, only valid as a decorator. def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... def __get__(self, __obj: _T, __type: Type[_T] | None = ...) -> Callable[..., Any]: ... if sys.version_info >= (3, 10): + __name__: str + __qualname__: str + __wrapped__: Callable[..., Any] def __call__(self, *args: Any, **kwargs: Any) -> Any: ... class classmethod(object): # Special, only valid as a decorator. @@ -130,6 +133,10 @@ class classmethod(object): # Special, only valid as a decorator. def __init__(self, __f: Callable[..., Any]) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... def __get__(self, __obj: _T, __type: Type[_T] | None = ...) -> Callable[..., Any]: ... + if sys.version_info >= (3, 10): + __name__: str + __qualname__: str + __wrapped__: Callable[..., Any] class type(object): __base__: type