@@ -83,6 +83,7 @@ _T4 = TypeVar("_T4")
83
83
_T5 = TypeVar ("_T5" )
84
84
_TT = TypeVar ("_TT" , bound = "type" )
85
85
_TBE = TypeVar ("_TBE" , bound = "BaseException" )
86
+ _R = TypeVar ("_R" ) # Return-type TypeVar
86
87
87
88
class object :
88
89
__doc__ : str | None
@@ -115,28 +116,28 @@ class object:
115
116
def __dir__ (self ) -> Iterable [str ]: ...
116
117
def __init_subclass__ (cls ) -> None : ...
117
118
118
- class staticmethod (object ): # Special, only valid as a decorator.
119
- __func__ : Callable [..., Any ]
119
+ class staticmethod (Generic [ _R ] ): # Special, only valid as a decorator.
120
+ __func__ : Callable [..., _R ]
120
121
__isabstractmethod__ : bool
121
- def __init__ (self , __f : Callable [..., Any ]) -> None : ...
122
+ def __init__ (self : staticmethod [ _R ] , __f : Callable [..., _R ]) -> None : ...
122
123
def __new__ (cls : Type [_T ], * args : Any , ** kwargs : Any ) -> _T : ...
123
- def __get__ (self , __obj : _T , __type : Type [_T ] | None = ...) -> Callable [..., Any ]: ...
124
+ def __get__ (self , __obj : _T , __type : Type [_T ] | None = ...) -> Callable [..., _R ]: ...
124
125
if sys .version_info >= (3 , 10 ):
125
126
__name__ : str
126
127
__qualname__ : str
127
- __wrapped__ : Callable [..., Any ]
128
- def __call__ (self , * args : Any , ** kwargs : Any ) -> Any : ...
128
+ __wrapped__ : Callable [..., _R ]
129
+ def __call__ (self , * args : Any , ** kwargs : Any ) -> _R : ...
129
130
130
- class classmethod (object ): # Special, only valid as a decorator.
131
- __func__ : Callable [..., Any ]
131
+ class classmethod (Generic [ _R ] ): # Special, only valid as a decorator.
132
+ __func__ : Callable [..., _R ]
132
133
__isabstractmethod__ : bool
133
- def __init__ (self , __f : Callable [..., Any ]) -> None : ...
134
+ def __init__ (self : classmethod [ _R ] , __f : Callable [..., _R ]) -> None : ...
134
135
def __new__ (cls : Type [_T ], * args : Any , ** kwargs : Any ) -> _T : ...
135
- def __get__ (self , __obj : _T , __type : Type [_T ] | None = ...) -> Callable [..., Any ]: ...
136
+ def __get__ (self , __obj : _T , __type : Type [_T ] | None = ...) -> Callable [..., _R ]: ...
136
137
if sys .version_info >= (3 , 10 ):
137
138
__name__ : str
138
139
__qualname__ : str
139
- __wrapped__ : Callable [..., Any ]
140
+ __wrapped__ : Callable [..., _R ]
140
141
141
142
class type (object ):
142
143
__base__ : type
0 commit comments