From dd83c67c47cfdffede68c0cea3755d2d738fd5fe Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 28 Jun 2021 17:18:20 +0200 Subject: [PATCH 01/17] Improve abc module and builtin function decorators * Make classmethod and staticmethod generic. * abstractclassmethod and abstractstaticmethod are classes, not functions. * Remove mypy-specific comments. --- stdlib/abc.pyi | 14 ++++++++------ stdlib/builtins.pyi | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/stdlib/abc.pyi b/stdlib/abc.pyi index bf98d5364101..e80cc2c5dd4e 100644 --- a/stdlib/abc.pyi +++ b/stdlib/abc.pyi @@ -1,13 +1,14 @@ from _typeshed import SupportsWrite -from typing import Any, Callable, Dict, Tuple, Type, TypeVar +from typing import Any, Callable, Generic, Tuple, Type, TypeVar _T = TypeVar("_T") +_R_co = TypeVar("_R_co", covariant=True) _FuncT = TypeVar("_FuncT", bound=Callable[..., Any]) # These definitions have special processing in mypy class ABCMeta(type): __abstractmethods__: frozenset[str] - def __init__(self, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> None: ... + def __init__(self, name: str, bases: Tuple[type, ...], namespace: dict[str, Any]) -> None: ... def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ... def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ... def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = ...) -> None: ... @@ -15,12 +16,13 @@ class ABCMeta(type): def abstractmethod(funcobj: _FuncT) -> _FuncT: ... -class abstractproperty(property): ... +class abstractclassmethod(classmethod[_R_co], Generic[_R_co]): + def __init__(self: abstractclassmethod[_R_co], callable: Callable[..., _R_co]) -> None: ... -# These two are deprecated and not supported by mypy -def abstractstaticmethod(callable: _FuncT) -> _FuncT: ... -def abstractclassmethod(callable: _FuncT) -> _FuncT: ... +class abstractstaticmethod(staticmethod[_FuncT], Generic[_FuncT]): + def __init__(self, callable: _FuncT) -> None: ... +class abstractproperty(property): ... class ABC(metaclass=ABCMeta): ... def get_cache_token() -> object: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 428139f422c5..138a7bc484a5 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -16,6 +16,7 @@ from _typeshed import ( SupportsWrite, ) from ast import AST, mod +from collections.abc import Callable from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper from types import CodeType, TracebackType from typing import ( @@ -26,7 +27,6 @@ from typing import ( AsyncIterator, BinaryIO, ByteString, - Callable, Dict, FrozenSet, Generic, @@ -70,6 +70,7 @@ class _SupportsTrunc(Protocol): _T = TypeVar("_T") _T_co = TypeVar("_T_co", covariant=True) _T_contra = TypeVar("_T_contra", contravariant=True) +_R_co = TypeVar("_R_co", covariant=True) _KT = TypeVar("_KT") _VT = TypeVar("_VT") _S = TypeVar("_S") @@ -80,6 +81,7 @@ _T4 = TypeVar("_T4") _T5 = TypeVar("_T5") _TT = TypeVar("_TT", bound="type") _TBE = TypeVar("_TBE", bound="BaseException") +_FuncT = TypeVar("_FuncT", bound=Callable[..., Any]) class object: __doc__: Optional[str] @@ -109,19 +111,19 @@ class object: def __dir__(self) -> Iterable[str]: ... def __init_subclass__(cls) -> None: ... -class staticmethod(object): # Special, only valid as a decorator. - __func__: Callable[..., Any] +class staticmethod(Generic[_FuncT]): # Special, only valid as a decorator. + __func__: _FuncT __isabstractmethod__: bool - def __init__(self, f: Callable[..., Any]) -> None: ... + def __init__(self, __f: _FuncT) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + def __get__(self, obj: _T, type: Type[_T] | None = ...) -> _FuncT: ... -class classmethod(object): # Special, only valid as a decorator. - __func__: Callable[..., Any] +class classmethod(Generic[_R_co]): # Special, only valid as a decorator. + __func__: Callable[..., _R_co] __isabstractmethod__: bool - def __init__(self, f: Callable[..., Any]) -> None: ... + def __init__(self: classmethod[_R_co], __f: Callable[..., _R_co]) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + def __get__(self, obj: _T | None, type: Type[_T] | None = ...) -> Callable[..., _R_co]: ... class type(object): __base__: type From f99fc5f6e7588f97cb7c12de2c3da805c3225d74 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 28 Jun 2021 18:57:30 +0200 Subject: [PATCH 02/17] Fix `__get__` Co-authored-by: Akuli --- stdlib/builtins.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 138a7bc484a5..512057b5b74c 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -116,7 +116,7 @@ class staticmethod(Generic[_FuncT]): # Special, only valid as a decorator. __isabstractmethod__: bool def __init__(self, __f: _FuncT) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Type[_T] | None = ...) -> _FuncT: ... + def __get__(self, obj: _T | None, type: Type[_T] | None = ...) -> _FuncT: ... class classmethod(Generic[_R_co]): # Special, only valid as a decorator. __func__: Callable[..., _R_co] From e049258a0605ecc8c997cce6d59404d60ae3b9ba Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 4 Oct 2021 20:18:36 +0200 Subject: [PATCH 03/17] Remove unused import --- stdlib/builtins.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 55254455d0a0..eee4545f3477 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -32,7 +32,6 @@ from typing import ( BinaryIO, ByteString, Callable, - Dict, FrozenSet, Generic, ItemsView, From 91ae24dbfbf317c887c1253a05f140a6f6f28d6f Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 4 Oct 2021 20:19:45 +0200 Subject: [PATCH 04/17] Fix duplicate import --- stdlib/builtins.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index eee4545f3477..c8b3817d4cbd 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -31,7 +31,6 @@ from typing import ( AsyncIterator, BinaryIO, ByteString, - Callable, FrozenSet, Generic, ItemsView, From c1d7c9cb9be27e1e88e9088d6e143840d828fbe5 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 4 Oct 2021 20:43:25 +0200 Subject: [PATCH 05/17] Try copying __get__ to abstract{class,static}method --- stdlib/abc.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/abc.pyi b/stdlib/abc.pyi index e80cc2c5dd4e..bcbc8e8e84a9 100644 --- a/stdlib/abc.pyi +++ b/stdlib/abc.pyi @@ -18,9 +18,11 @@ def abstractmethod(funcobj: _FuncT) -> _FuncT: ... class abstractclassmethod(classmethod[_R_co], Generic[_R_co]): def __init__(self: abstractclassmethod[_R_co], callable: Callable[..., _R_co]) -> None: ... + def __get__(self, obj: _T | None, type: Type[_T] | None = ...) -> Callable[..., _R_co]: ... class abstractstaticmethod(staticmethod[_FuncT], Generic[_FuncT]): def __init__(self, callable: _FuncT) -> None: ... + def __get__(self, obj: _T | None, type: Type[_T] | None = ...) -> _FuncT: ... class abstractproperty(property): ... class ABC(metaclass=ABCMeta): ... From 060212b6c2e3883f6148d800c7cdc19801f6037a Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 4 Oct 2021 20:47:45 +0200 Subject: [PATCH 06/17] Add __isabstractmethod__ Import Callable from collections.abc --- stdlib/abc.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stdlib/abc.pyi b/stdlib/abc.pyi index bcbc8e8e84a9..5bd40622493c 100644 --- a/stdlib/abc.pyi +++ b/stdlib/abc.pyi @@ -1,5 +1,7 @@ from _typeshed import SupportsWrite -from typing import Any, Callable, Generic, Tuple, Type, TypeVar +from collections.abc import Callable +from typing import Any, Generic, Tuple, Type, TypeVar +from typing_extensions import Literal _T = TypeVar("_T") _R_co = TypeVar("_R_co", covariant=True) @@ -17,10 +19,12 @@ class ABCMeta(type): def abstractmethod(funcobj: _FuncT) -> _FuncT: ... class abstractclassmethod(classmethod[_R_co], Generic[_R_co]): + __isabstractmethod__: Literal[True] def __init__(self: abstractclassmethod[_R_co], callable: Callable[..., _R_co]) -> None: ... def __get__(self, obj: _T | None, type: Type[_T] | None = ...) -> Callable[..., _R_co]: ... class abstractstaticmethod(staticmethod[_FuncT], Generic[_FuncT]): + __isabstractmethod__: Literal[True] def __init__(self, callable: _FuncT) -> None: ... def __get__(self, obj: _T | None, type: Type[_T] | None = ...) -> _FuncT: ... From fe282c8a89b5ea3929c74c495096ccaae779247c Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 4 Oct 2021 20:50:59 +0200 Subject: [PATCH 07/17] Add abstract*.__get__ to stubtest allowlist --- tests/stubtest_allowlists/py3_common.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index 25f81d3ec6de..09e813f208dd 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -16,7 +16,9 @@ _socket.* _threading_local.local.__new__ _typeshed.* # Utility types for typeshed, doesn't exist at runtime abc.abstractclassmethod +abc.abstractclassmethod.__get__ abc.abstractstaticmethod +abc.abstractstaticmethod.__get__ abc.ABCMeta.__new__ # pytype wants the parameter named cls and not mcls _weakref.CallableProxyType.__getattr__ # Should have all attributes of proxy _weakref.ProxyType.__getattr__ # Should have all attributes of proxy From f82f04a2662a92ceee393ccb63226b009612776a Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 4 Oct 2021 20:57:22 +0200 Subject: [PATCH 08/17] Remove abstract*.__get__ again --- stdlib/abc.pyi | 2 -- tests/stubtest_allowlists/py3_common.txt | 2 -- 2 files changed, 4 deletions(-) diff --git a/stdlib/abc.pyi b/stdlib/abc.pyi index 5bd40622493c..4e60f84bfa90 100644 --- a/stdlib/abc.pyi +++ b/stdlib/abc.pyi @@ -21,12 +21,10 @@ def abstractmethod(funcobj: _FuncT) -> _FuncT: ... class abstractclassmethod(classmethod[_R_co], Generic[_R_co]): __isabstractmethod__: Literal[True] def __init__(self: abstractclassmethod[_R_co], callable: Callable[..., _R_co]) -> None: ... - def __get__(self, obj: _T | None, type: Type[_T] | None = ...) -> Callable[..., _R_co]: ... class abstractstaticmethod(staticmethod[_FuncT], Generic[_FuncT]): __isabstractmethod__: Literal[True] def __init__(self, callable: _FuncT) -> None: ... - def __get__(self, obj: _T | None, type: Type[_T] | None = ...) -> _FuncT: ... class abstractproperty(property): ... class ABC(metaclass=ABCMeta): ... diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index 09e813f208dd..25f81d3ec6de 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -16,9 +16,7 @@ _socket.* _threading_local.local.__new__ _typeshed.* # Utility types for typeshed, doesn't exist at runtime abc.abstractclassmethod -abc.abstractclassmethod.__get__ abc.abstractstaticmethod -abc.abstractstaticmethod.__get__ abc.ABCMeta.__new__ # pytype wants the parameter named cls and not mcls _weakref.CallableProxyType.__getattr__ # Should have all attributes of proxy _weakref.ProxyType.__getattr__ # Should have all attributes of proxy From 6f449b334659dda9e645db283f8f3fabb1c60577 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Dec 2021 11:17:27 +0000 Subject: [PATCH 09/17] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/builtins.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index e5e8f011f797..2f7f07b0c523 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -132,7 +132,7 @@ class classmethod(Generic[_R_co]): # Special, only valid as a decorator. __isabstractmethod__: bool def __init__(self: classmethod[_R_co], __f: Callable[..., _R_co]) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, __obj: _T, __type: Type[_T] | None = ...) -> Callable[...,_R_co]: ... + def __get__(self, __obj: _T, __type: Type[_T] | None = ...) -> Callable[..., _R_co]: ... if sys.version_info >= (3, 10): __name__: str __qualname__: str From 7bb6c2847e8679cb69fc66837c4fd650fb6f6320 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 22 Dec 2021 12:20:23 +0100 Subject: [PATCH 10/17] Remove unused allowlist entries --- tests/stubtest_allowlists/py3_common.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index f8eb6123866b..a4a20b33765a 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -15,8 +15,6 @@ _socket.* _threading_local.local.__new__ _typeshed.* # Utility types for typeshed, doesn't exist at runtime _weakref.ref.__call__ -abc.abstractclassmethod # Deprecated, unsupported by mypy, hard to fix. #6552 -abc.abstractstaticmethod # Deprecated, unsupported by mypy, hard to fix. #6552 abc.ABCMeta.__new__ # pytype wants the parameter named cls and not mcls _weakref.CallableProxyType.__getattr__ # Should have all attributes of proxy _weakref.ProxyType.__getattr__ # Should have all attributes of proxy From a0e344e0205d0ff26d74d142441576a25033fb5b Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 22 Dec 2021 13:03:07 +0100 Subject: [PATCH 11/17] Remove unused type var --- stdlib/builtins.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 2f7f07b0c523..749c51f83a61 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -74,7 +74,6 @@ _T4 = TypeVar("_T4") _T5 = TypeVar("_T5") _TT = TypeVar("_TT", bound="type") _TBE = TypeVar("_TBE", bound="BaseException") -_FuncT = TypeVar("_FuncT", bound=Callable[..., Any]) _SupportsNextT = TypeVar("_SupportsNextT", bound=SupportsNext[Any], covariant=True) _SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant=True) From a12c70e9d89b5e236f7f0904c1038b86029b4639 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 22 Dec 2021 13:05:25 +0100 Subject: [PATCH 12/17] Make abstractstaticmethod generic match staticmethod --- stdlib/abc.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/abc.pyi b/stdlib/abc.pyi index e5e29837d8b6..533f43f2e992 100644 --- a/stdlib/abc.pyi +++ b/stdlib/abc.pyi @@ -23,9 +23,9 @@ class abstractclassmethod(classmethod[_R_co], Generic[_R_co]): __isabstractmethod__: Literal[True] def __init__(self: abstractclassmethod[_R_co], callable: Callable[..., _R_co]) -> None: ... -class abstractstaticmethod(staticmethod[_FuncT], Generic[_FuncT]): +class abstractstaticmethod(staticmethod[_R_co], Generic[_R_co]): __isabstractmethod__: Literal[True] - def __init__(self, callable: _FuncT) -> None: ... + def __init__(self, callable: Callable[..., _R_co]) -> None: ... class abstractproperty(property): ... class ABC(metaclass=ABCMeta): ... From 399dbd4bfe6649b651d2db5d6755de235e430863 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sat, 8 Jan 2022 13:08:48 +0100 Subject: [PATCH 13/17] Update pytest --- requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 3f50e343a37d..b0d3140b6781 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,5 +1,5 @@ mypy==0.930 -pytype==2021.11.29; platform_system != "Windows" +pytype==2022.01.07; platform_system != "Windows" # must match .pre-commit-config.yaml black==21.12b0 flake8==4.0.1 From 0e60382b3c8d33e1ceb4fa6f93a5f6ed6683648e Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sun, 9 Jan 2022 18:41:20 +0200 Subject: [PATCH 14/17] Update stdlib/abc.pyi --- stdlib/abc.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/abc.pyi b/stdlib/abc.pyi index c63f24edf9b0..61b162bf8821 100644 --- a/stdlib/abc.pyi +++ b/stdlib/abc.pyi @@ -1,7 +1,7 @@ import sys from _typeshed import SupportsWrite from collections.abc import Callable -from typing import Any, Generic, Type, TypeVar +from typing import Any, Generic, TypeVar from typing_extensions import Literal _T = TypeVar("_T") From a3475b5a5f6f854b74918ce6d82796e6e95d64e5 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sun, 9 Jan 2022 18:42:14 +0200 Subject: [PATCH 15/17] lowercase type --- stdlib/builtins.pyi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index d4b4aa7dc78c..dcf24b155c95 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -118,8 +118,8 @@ class staticmethod(Generic[_R_co]): # Special, only valid as a decorator. __func__: Callable[..., _R_co] __isabstractmethod__: bool def __init__(self: staticmethod[_R_co], __f: Callable[..., _R_co]) -> None: ... - def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, __obj: _T, __type: Type[_T] | None = ...) -> Callable[..., _R_co]: ... + def __new__(cls: type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, __obj: _T, __type: type[_T] | None = ...) -> Callable[..., _R_co]: ... if sys.version_info >= (3, 10): __name__: str __qualname__: str @@ -130,8 +130,8 @@ class classmethod(Generic[_R_co]): # Special, only valid as a decorator. __func__: Callable[..., _R_co] __isabstractmethod__: bool def __init__(self: classmethod[_R_co], __f: Callable[..., _R_co]) -> None: ... - def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, __obj: _T, __type: Type[_T] | None = ...) -> Callable[..., _R_co]: ... + def __new__(cls: type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, __obj: _T, __type: type[_T] | None = ...) -> Callable[..., _R_co]: ... if sys.version_info >= (3, 10): __name__: str __qualname__: str From 7c901cfbeb6289b4052f0b1ae4ea6a0affe8374c Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 2 Feb 2022 15:19:33 +0100 Subject: [PATCH 16/17] Fix merge errors --- stdlib/builtins.pyi | 3 --- 1 file changed, 3 deletions(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 5175dc70b8d2..5e2265f702cc 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -70,9 +70,6 @@ _T2 = TypeVar("_T2") _T3 = TypeVar("_T3") _T4 = TypeVar("_T4") _T5 = TypeVar("_T5") -_TT = TypeVar("_TT", bound="type") -_TBE = TypeVar("_TBE", bound="BaseException") -_R = TypeVar("_R") # Return-type TypeVar _SupportsNextT = TypeVar("_SupportsNextT", bound=SupportsNext[Any], covariant=True) _SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant=True) From 2f8f6cd2b9898ed76701cea8d9fa0dec092140ee Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 2 Feb 2022 16:11:33 +0100 Subject: [PATCH 17/17] Remove wrong comments --- stdlib/builtins.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 5e2265f702cc..a42cd04236db 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -112,7 +112,7 @@ class object: def __dir__(self) -> Iterable[str]: ... def __init_subclass__(cls) -> None: ... -class staticmethod(Generic[_R_co]): # Special, only valid as a decorator. +class staticmethod(Generic[_R_co]): __func__: Callable[..., _R_co] __isabstractmethod__: bool def __init__(self: staticmethod[_R_co], __f: Callable[..., _R_co]) -> None: ... @@ -123,7 +123,7 @@ class staticmethod(Generic[_R_co]): # Special, only valid as a decorator. __wrapped__: Callable[..., _R_co] def __call__(self, *args: Any, **kwargs: Any) -> _R_co: ... -class classmethod(Generic[_R_co]): # Special, only valid as a decorator. +class classmethod(Generic[_R_co]): __func__: Callable[..., _R_co] __isabstractmethod__: bool def __init__(self: classmethod[_R_co], __f: Callable[..., _R_co]) -> None: ...