@@ -7,7 +7,6 @@ from typing import ( # noqa: Y022,Y038,UP035
77 AsyncIterable as AsyncIterable ,
88 AsyncIterator as AsyncIterator ,
99 Awaitable as Awaitable ,
10- Callable as Callable ,
1110 ClassVar ,
1211 Collection as Collection ,
1312 Container as Container ,
@@ -31,7 +30,7 @@ from typing import ( # noqa: Y022,Y038,UP035
3130 TypeVar ,
3231 ValuesView as ValuesView ,
3332 final ,
34- runtime_checkable ,
33+ runtime_checkable , ParamSpec ,
3534)
3635
3736__all__ = [
@@ -68,9 +67,18 @@ if sys.version_info < (3, 14):
6867if sys .version_info >= (3 , 12 ):
6968 __all__ += ["Buffer" ]
7069
70+ _T_co = TypeVar ("_T_co" , covariant = True )
7171_KT_co = TypeVar ("_KT_co" , covariant = True ) # Key type covariant containers.
7272_VT_co = TypeVar ("_VT_co" , covariant = True ) # Value type covariant containers.
7373
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+
7482@final
7583class dict_keys (KeysView [_KT_co ], Generic [_KT_co , _VT_co ]): # undocumented
7684 def __eq__ (self , value : object , / ) -> bool : ...
0 commit comments