11import sys
22from _ctypes import (
3+ POINTER as POINTER ,
34 RTLD_GLOBAL as RTLD_GLOBAL ,
45 RTLD_LOCAL as RTLD_LOCAL ,
56 ArgumentError as ArgumentError ,
67 Array as Array ,
78 Structure as Structure ,
89 Union as Union ,
10+ _CanCastTo as _CanCastTo ,
911 _CData as _CData ,
1012 _CDataMeta as _CDataMeta ,
1113 _CField as _CField ,
14+ _Pointer as _Pointer ,
15+ _PointerLike as _PointerLike ,
1216 _SimpleCData as _SimpleCData ,
1317 _StructUnionBase as _StructUnionBase ,
1418 _StructUnionMeta as _StructUnionMeta ,
1519 addressof as addressof ,
1620 alignment as alignment ,
1721 get_errno as get_errno ,
22+ pointer as pointer ,
1823 resize as resize ,
1924 set_errno as set_errno ,
2025 sizeof as sizeof ,
@@ -31,7 +36,6 @@ if sys.version_info >= (3, 9):
3136
3237_T = TypeVar ("_T" )
3338_DLLT = TypeVar ("_DLLT" , bound = CDLL )
34- _CT = TypeVar ("_CT" , bound = _CData )
3539
3640DEFAULT_MODE : int
3741
@@ -85,9 +89,6 @@ if sys.platform == "win32":
8589pydll : LibraryLoader [PyDLL ]
8690pythonapi : PyDLL
8791
88- class _CanCastTo (_CData ): ...
89- class _PointerLike (_CanCastTo ): ...
90-
9192_ECT : TypeAlias = Callable [[type [_CData ] | None , _FuncPointer , tuple [_CData , ...]], _CData ]
9293_PF : TypeAlias = tuple [int ] | tuple [int , str ] | tuple [int , str , Any ]
9394
@@ -148,22 +149,6 @@ if sys.platform == "win32":
148149
149150def memmove (dst : _CVoidPLike , src : _CVoidConstPLike , count : int ) -> int : ...
150151def 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 ]: ...
167152def string_at (address : _CVoidConstPLike , size : int = - 1 ) -> bytes : ...
168153
169154if sys .platform == "win32" :
0 commit comments