@@ -310,16 +310,16 @@ def __call__(self, *_args: Any) -> Any:
310310
311311
312312_P = ParamSpec ('_P' )
313- _T = TypeVar ('_T ' , covariant = True )
313+ _T_co = TypeVar ('_T_co ' , covariant = True )
314314
315315
316- class _Func (Protocol [_P , _T ]):
316+ class _Func (Protocol [_P , _T_co ]):
317317 available : bool
318318
319- def __call__ (self , * args : _P .args ) -> _T : ... # type: ignore[valid-type]
319+ def __call__ (self , * args : _P .args ) -> _T_co : ... # type: ignore[valid-type]
320320
321321
322- class _CTypesFunc (_Func [_P , _T ]):
322+ class _CTypesFunc (_Func [_P , _T_co ]):
323323 restype : type | None
324324 argtypes : list [type ]
325325 errcheck : _ErrCheck
@@ -337,9 +337,9 @@ def _func(
337337 argtypes : list [type ],
338338 errcheck : _ErrCheck = _check_error ,
339339 minimum_version : str | None = None ,
340- ) -> _Func [_P , _T ]:
340+ ) -> _Func [_P , _T_co ]:
341341 try :
342- func : _CTypesFunc [_P , _T ] = getattr (_lib , name )
342+ func : _CTypesFunc [_P , _T_co ] = getattr (_lib , name )
343343 except AttributeError :
344344 if minimum_version is None :
345345 raise
@@ -355,9 +355,9 @@ def _func(
355355
356356def _wraps_funcs (
357357 wrapped : list [_Func [..., Any ]],
358- ) -> Callable [[Callable [_P , _T ]], _Func [_P , _T ]]:
359- def decorator (fn : Callable [_P , _T ]) -> _Func [_P , _T ]:
360- f = cast ('_Func[_P, _T ]' , fn )
358+ ) -> Callable [[Callable [_P , _T_co ]], _Func [_P , _T_co ]]:
359+ def decorator (fn : Callable [_P , _T_co ]) -> _Func [_P , _T_co ]:
360+ f = cast ('_Func[_P, _T_co ]' , fn )
361361 f .available = True
362362 for w in wrapped :
363363 f .available = f .available and w .available
0 commit comments