@@ -22,6 +22,7 @@ from _typeshed import (
22
22
SupportsTrunc ,
23
23
SupportsWrite ,
24
24
)
25
+ from collections .abc import Callable
25
26
from io import BufferedRandom , BufferedReader , BufferedWriter , FileIO , TextIOWrapper
26
27
from types import CodeType , TracebackType , _Cell
27
28
from typing import (
@@ -30,7 +31,6 @@ from typing import (
30
31
Any ,
31
32
BinaryIO ,
32
33
ByteString ,
33
- Callable ,
34
34
Generic ,
35
35
Iterable ,
36
36
Iterator ,
@@ -61,6 +61,7 @@ if sys.version_info >= (3, 9):
61
61
_T = TypeVar ("_T" )
62
62
_T_co = TypeVar ("_T_co" , covariant = True )
63
63
_T_contra = TypeVar ("_T_contra" , contravariant = True )
64
+ _R_co = TypeVar ("_R_co" , covariant = True )
64
65
_KT = TypeVar ("_KT" )
65
66
_VT = TypeVar ("_VT" )
66
67
_S = TypeVar ("_S" )
@@ -69,7 +70,6 @@ _T2 = TypeVar("_T2")
69
70
_T3 = TypeVar ("_T3" )
70
71
_T4 = TypeVar ("_T4" )
71
72
_T5 = TypeVar ("_T5" )
72
- _R = TypeVar ("_R" ) # Return-type TypeVar
73
73
_SupportsNextT = TypeVar ("_SupportsNextT" , bound = SupportsNext [Any ], covariant = True )
74
74
_SupportsAnextT = TypeVar ("_SupportsAnextT" , bound = SupportsAnext [Any ], covariant = True )
75
75
@@ -112,26 +112,26 @@ class object:
112
112
def __dir__ (self ) -> Iterable [str ]: ...
113
113
def __init_subclass__ (cls ) -> None : ...
114
114
115
- class staticmethod (Generic [_R ]):
116
- __func__ : Callable [..., _R ]
115
+ class staticmethod (Generic [_R_co ]):
116
+ __func__ : Callable [..., _R_co ]
117
117
__isabstractmethod__ : bool
118
- def __init__ (self : staticmethod [_R ], __f : Callable [..., _R ]) -> None : ...
119
- def __get__ (self , __obj : _T , __type : type [_T ] | None = ...) -> Callable [..., _R ]: ...
118
+ def __init__ (self : staticmethod [_R_co ], __f : Callable [..., _R_co ]) -> None : ...
119
+ def __get__ (self , __obj : _T , __type : type [_T ] | None = ...) -> Callable [..., _R_co ]: ...
120
120
if sys .version_info >= (3 , 10 ):
121
121
__name__ : str
122
122
__qualname__ : str
123
- __wrapped__ : Callable [..., _R ]
124
- def __call__ (self , * args : Any , ** kwargs : Any ) -> _R : ...
123
+ __wrapped__ : Callable [..., _R_co ]
124
+ def __call__ (self , * args : Any , ** kwargs : Any ) -> _R_co : ...
125
125
126
- class classmethod (Generic [_R ]):
127
- __func__ : Callable [..., _R ]
126
+ class classmethod (Generic [_R_co ]):
127
+ __func__ : Callable [..., _R_co ]
128
128
__isabstractmethod__ : bool
129
- def __init__ (self : classmethod [_R ], __f : Callable [..., _R ]) -> None : ...
130
- def __get__ (self , __obj : _T , __type : type [_T ] | None = ...) -> Callable [..., _R ]: ...
129
+ def __init__ (self : classmethod [_R_co ], __f : Callable [..., _R_co ]) -> None : ...
130
+ def __get__ (self , __obj : _T , __type : type [_T ] | None = ...) -> Callable [..., _R_co ]: ...
131
131
if sys .version_info >= (3 , 10 ):
132
132
__name__ : str
133
133
__qualname__ : str
134
- __wrapped__ : Callable [..., _R ]
134
+ __wrapped__ : Callable [..., _R_co ]
135
135
136
136
class type :
137
137
__base__ : type
0 commit comments