1
1
import sys
2
2
from _ctypes import (
3
+ POINTER as POINTER ,
3
4
RTLD_GLOBAL as RTLD_GLOBAL ,
4
5
RTLD_LOCAL as RTLD_LOCAL ,
5
6
ArgumentError as ArgumentError ,
6
7
Array as Array ,
7
8
Structure as Structure ,
8
9
Union as Union ,
10
+ _CanCastTo as _CanCastTo ,
9
11
_CData as _CData ,
10
12
_CDataMeta as _CDataMeta ,
11
13
_CField as _CField ,
14
+ _Pointer as _Pointer ,
15
+ _PointerLike as _PointerLike ,
12
16
_SimpleCData as _SimpleCData ,
13
17
_StructUnionBase as _StructUnionBase ,
14
18
_StructUnionMeta as _StructUnionMeta ,
15
19
addressof as addressof ,
16
20
alignment as alignment ,
17
21
get_errno as get_errno ,
22
+ pointer as pointer ,
18
23
resize as resize ,
19
24
set_errno as set_errno ,
20
25
sizeof as sizeof ,
@@ -31,7 +36,6 @@ if sys.version_info >= (3, 9):
31
36
32
37
_T = TypeVar ("_T" )
33
38
_DLLT = TypeVar ("_DLLT" , bound = CDLL )
34
- _CT = TypeVar ("_CT" , bound = _CData )
35
39
36
40
DEFAULT_MODE : int
37
41
@@ -85,9 +89,6 @@ if sys.platform == "win32":
85
89
pydll : LibraryLoader [PyDLL ]
86
90
pythonapi : PyDLL
87
91
88
- class _CanCastTo (_CData ): ...
89
- class _PointerLike (_CanCastTo ): ...
90
-
91
92
_ECT : TypeAlias = Callable [[type [_CData ] | None , _FuncPointer , tuple [_CData , ...]], _CData ]
92
93
_PF : TypeAlias = tuple [int ] | tuple [int , str ] | tuple [int , str , Any ]
93
94
@@ -148,22 +149,6 @@ if sys.platform == "win32":
148
149
149
150
def memmove (dst : _CVoidPLike , src : _CVoidConstPLike , count : int ) -> int : ...
150
151
def memset (dst : _CVoidPLike , c : int , count : int ) -> int : ...
151
- def POINTER (type : type [_CT ]) -> type [_Pointer [_CT ]]: ...
152
-
153
- class _Pointer (Generic [_CT ], _PointerLike , _CData ):
154
- _type_ : type [_CT ]
155
- contents : _CT
156
- @overload
157
- def __init__ (self ) -> None : ...
158
- @overload
159
- def __init__ (self , arg : _CT ) -> None : ...
160
- @overload
161
- def __getitem__ (self , __key : int ) -> Any : ...
162
- @overload
163
- def __getitem__ (self , __key : slice ) -> list [Any ]: ...
164
- def __setitem__ (self , __key : int , __value : Any ) -> None : ...
165
-
166
- def pointer (__arg : _CT ) -> _Pointer [_CT ]: ...
167
152
def string_at (address : _CVoidConstPLike , size : int = - 1 ) -> bytes : ...
168
153
169
154
if sys .platform == "win32" :
0 commit comments