@@ -62,7 +62,7 @@ if sys.version_info >= (3, 13):
6262
6363_T1 = TypeVar ("_T1" )
6464_T2 = TypeVar ("_T2" )
65- _KT = TypeVar ("_KT" )
65+ _KT_co = TypeVar ("_KT_co" , covariant = True )
6666_VT_co = TypeVar ("_VT_co" , covariant = True )
6767
6868# Make sure this class definition stays roughly in line with `builtins.function`
@@ -302,25 +302,25 @@ class CodeType:
302302 __replace__ = replace
303303
304304@final
305- class MappingProxyType (Mapping [_KT , _VT_co ]):
305+ class MappingProxyType (Mapping [_KT_co , _VT_co ]): # type: ignore[type-var] # pyright: ignore[reportInvalidTypeArguments]
306306 __hash__ : ClassVar [None ] # type: ignore[assignment]
307- def __new__ (cls , mapping : SupportsKeysAndGetItem [_KT , _VT_co ]) -> Self : ...
308- def __getitem__ (self , key : _KT , / ) -> _VT_co : ...
309- def __iter__ (self ) -> Iterator [_KT ]: ...
307+ def __new__ (cls , mapping : SupportsKeysAndGetItem [_KT_co , _VT_co ]) -> Self : ...
308+ def __getitem__ (self , key : _KT_co , / ) -> _VT_co : ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
309+ def __iter__ (self ) -> Iterator [_KT_co ]: ...
310310 def __len__ (self ) -> int : ...
311311 def __eq__ (self , value : object , / ) -> bool : ...
312- def copy (self ) -> dict [_KT , _VT_co ]: ...
313- def keys (self ) -> KeysView [_KT ]: ...
312+ def copy (self ) -> dict [_KT_co , _VT_co ]: ...
313+ def keys (self ) -> KeysView [_KT_co ]: ...
314314 def values (self ) -> ValuesView [_VT_co ]: ...
315- def items (self ) -> ItemsView [_KT , _VT_co ]: ...
315+ def items (self ) -> ItemsView [_KT_co , _VT_co ]: ...
316316 @overload
317- def get (self , key : _KT , / ) -> _VT_co | None : ...
317+ def get (self , key : _KT_co , / ) -> _VT_co | None : ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
318318 @overload
319- def get (self , key : _KT , default : _VT_co | _T2 , / ) -> _VT_co | _T2 : ...
319+ def get (self , key : _KT_co , default : _VT_co | _T2 , / ) -> _VT_co | _T2 : ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
320320 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
321- def __reversed__ (self ) -> Iterator [_KT ]: ...
322- def __or__ (self , value : Mapping [_T1 , _T2 ], / ) -> dict [_KT | _T1 , _VT_co | _T2 ]: ...
323- def __ror__ (self , value : Mapping [_T1 , _T2 ], / ) -> dict [_KT | _T1 , _VT_co | _T2 ]: ...
321+ def __reversed__ (self ) -> Iterator [_KT_co ]: ...
322+ def __or__ (self , value : Mapping [_T1 , _T2 ], / ) -> dict [_KT_co | _T1 , _VT_co | _T2 ]: ...
323+ def __ror__ (self , value : Mapping [_T1 , _T2 ], / ) -> dict [_KT_co | _T1 , _VT_co | _T2 ]: ...
324324
325325class SimpleNamespace :
326326 __hash__ : ClassVar [None ] # type: ignore[assignment]
0 commit comments