@@ -7,7 +7,6 @@ from typing import ( # noqa: Y022,Y038,UP035
7
7
AsyncIterable as AsyncIterable ,
8
8
AsyncIterator as AsyncIterator ,
9
9
Awaitable as Awaitable ,
10
- Callable as Callable ,
11
10
ClassVar ,
12
11
Collection as Collection ,
13
12
Container as Container ,
@@ -31,7 +30,7 @@ from typing import ( # noqa: Y022,Y038,UP035
31
30
TypeVar ,
32
31
ValuesView as ValuesView ,
33
32
final ,
34
- runtime_checkable ,
33
+ runtime_checkable , ParamSpec ,
35
34
)
36
35
37
36
__all__ = [
@@ -68,9 +67,18 @@ if sys.version_info < (3, 14):
68
67
if sys .version_info >= (3 , 12 ):
69
68
__all__ += ["Buffer" ]
70
69
70
+ _T_co = TypeVar ("_T_co" , covariant = True )
71
71
_KT_co = TypeVar ("_KT_co" , covariant = True ) # Key type covariant containers.
72
72
_VT_co = TypeVar ("_VT_co" , covariant = True ) # Value type covariant containers.
73
73
74
+ _P = ParamSpec ("_P" )
75
+
76
+
77
+ class Callable (Protocol [_P , _T_co ]):
78
+ @abstractmethod
79
+ def __call__ (self , * args : _P .args , ** kwargs : _P .kwargs ) -> _T_co : ...
80
+
81
+
74
82
@final
75
83
class dict_keys (KeysView [_KT_co ], Generic [_KT_co , _VT_co ]): # undocumented
76
84
def __eq__ (self , value : object , / ) -> bool : ...
0 commit comments