@@ -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 ,
@@ -25,6 +24,7 @@ from typing import ( # noqa: Y022,Y038,UP035,Y057
25
24
MutableMapping as MutableMapping ,
26
25
MutableSequence as MutableSequence ,
27
26
MutableSet as MutableSet ,
27
+ ParamSpec ,
28
28
Protocol ,
29
29
Reversible as Reversible ,
30
30
Sequence as Sequence ,
@@ -65,9 +65,16 @@ __all__ = [
65
65
if sys .version_info >= (3 , 12 ):
66
66
__all__ += ["Buffer" ]
67
67
68
+ _T_co = TypeVar ("_T_co" , covariant = True )
68
69
_KT_co = TypeVar ("_KT_co" , covariant = True ) # Key type covariant containers.
69
70
_VT_co = TypeVar ("_VT_co" , covariant = True ) # Value type covariant containers.
70
71
72
+ _P = ParamSpec ("_P" )
73
+
74
+ class Callable (Protocol [_P , _T_co ]):
75
+ @abstractmethod
76
+ def __call__ (self , * args : _P .args , ** kwargs : _P .kwargs ) -> _T_co : ...
77
+
71
78
@final
72
79
class dict_keys (KeysView [_KT_co ], Generic [_KT_co , _VT_co ]): # undocumented
73
80
def __eq__ (self , value : object , / ) -> bool : ...
0 commit comments