|
1 | 1 | import ctypes as ct
|
2 | 2 | from _ctypes import CFuncPtr as _CFuncPtr
|
3 | 3 | from types import ModuleType
|
4 |
| -from typing import ClassVar, Generic, Literal, NoReturn, Protocol, TypeAlias, final, overload, type_check_only |
5 |
| -from typing_extensions import CapsuleType as PyCapsule, Self, TypeVar, TypeVarTuple, Unpack, override |
| 4 | +from typing import ClassVar, Generic, Literal, NoReturn, Protocol, Self, TypeAlias, final, overload, type_check_only |
| 5 | +from typing_extensions import CapsuleType as PyCapsule, TypeVar, TypeVarTuple, Unpack, override |
6 | 6 |
|
7 | 7 | # some quick interfaces for the relevant `cffi` types
|
8 | 8 |
|
@@ -57,25 +57,25 @@ class _CFFIVoid(_CFFIType, Protocol):
|
57 | 57 | def __init__(self, /) -> None: ...
|
58 | 58 |
|
59 | 59 | @type_check_only
|
60 |
| -class _CFFIFunc(_CFFIType, Protocol[_CT_co, Unpack[_CTs]]): |
| 60 | +class _CFFIFunc(_CFFIType, Protocol[_CT_co, *_CTs]): |
61 | 61 | is_array_type: ClassVar[bool] = False
|
62 | 62 |
|
63 | 63 | @property
|
64 |
| - def args(self, /) -> tuple[Unpack[_CTs]]: ... |
| 64 | + def args(self, /) -> tuple[*_CTs]: ... |
65 | 65 | @property
|
66 | 66 | def result(self, /) -> _CT_co: ...
|
67 | 67 | @property
|
68 | 68 | def ellipsis(self, /) -> bool: ...
|
69 | 69 | @property
|
70 | 70 | def abi(self, /) -> int | str | None: ...
|
71 |
| - def __init__(self, /, args: tuple[Unpack[_CTs]], result: _CT_co, ellipsis: bool, abi: int | None = None) -> None: ... |
| 71 | + def __init__(self, /, args: tuple[*_CTs], result: _CT_co, ellipsis: bool, abi: int | None = None) -> None: ... |
72 | 72 |
|
73 | 73 | @type_check_only
|
74 | 74 | @final
|
75 |
| -class _CFFIFuncPtr(_CFFIFunc[_CT_co, Unpack[_CTs]], Protocol[_CT_co, Unpack[_CTs]]): |
| 75 | +class _CFFIFuncPtr(_CFFIFunc[_CT_co, *_CTs], Protocol[_CT_co, *_CTs]): |
76 | 76 | is_raw_function: ClassVar = False
|
77 | 77 |
|
78 |
| - def as_raw_function(self, /) -> _CFFIFunc[_CT_co, Unpack[_CTs]]: ... |
| 78 | + def as_raw_function(self, /) -> _CFFIFunc[_CT_co, *_CTs]: ... |
79 | 79 |
|
80 | 80 | @type_check_only
|
81 | 81 | @final
|
|
0 commit comments