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