@@ -24,16 +24,16 @@ _T = TypeVar("_T")
2424_DLLT = TypeVar ("_DLLT" , bound = CDLL )
2525_CT = TypeVar ("_CT" , bound = _CData )
2626
27- RTLD_GLOBAL : int = ...
28- RTLD_LOCAL : int = ...
29- DEFAULT_MODE : int = ...
27+ RTLD_GLOBAL : int
28+ RTLD_LOCAL : int
29+ DEFAULT_MODE : int
3030
3131class CDLL (object ):
32- _func_flags_ : ClassVar [int ] = ...
33- _func_restype_ : ClassVar [_CData ] = ...
34- _name : str = ...
35- _handle : int = ...
36- _FuncPtr : Type [_FuncPointer ] = ...
32+ _func_flags_ : ClassVar [int ]
33+ _func_restype_ : ClassVar [_CData ]
34+ _name : str
35+ _handle : int
36+ _FuncPtr : Type [_FuncPointer ]
3737 if sys .version_info >= (3 , 8 ):
3838 def __init__ (
3939 self ,
@@ -65,12 +65,12 @@ class LibraryLoader(Generic[_DLLT]):
6565 if sys .version_info >= (3 , 9 ):
6666 def __class_getitem__ (cls , item : Any ) -> GenericAlias : ...
6767
68- cdll : LibraryLoader [CDLL ] = ...
68+ cdll : LibraryLoader [CDLL ]
6969if sys .platform == "win32" :
70- windll : LibraryLoader [WinDLL ] = ...
71- oledll : LibraryLoader [OleDLL ] = ...
72- pydll : LibraryLoader [PyDLL ] = ...
73- pythonapi : PyDLL = ...
70+ windll : LibraryLoader [WinDLL ]
71+ oledll : LibraryLoader [OleDLL ]
72+ pydll : LibraryLoader [PyDLL ]
73+ pythonapi : PyDLL
7474
7575# Anything that implements the read-write buffer interface.
7676# The buffer interface is defined purely on the C level, so we cannot define a normal Protocol
@@ -87,9 +87,9 @@ class _CDataMeta(type):
8787 def __rmul__ (cls : Type [_CT ], other : int ) -> Type [Array [_CT ]]: ... # type: ignore
8888
8989class _CData (metaclass = _CDataMeta ):
90- _b_base : int = ...
91- _b_needsfree_ : bool = ...
92- _objects : Mapping [Any , int ] | None = ...
90+ _b_base : int
91+ _b_needsfree_ : bool
92+ _objects : Mapping [Any , int ] | None
9393 @classmethod
9494 def from_buffer (cls : Type [_CT ], source : _WritableBuffer , offset : int = ...) -> _CT : ...
9595 @classmethod
@@ -108,9 +108,9 @@ _ECT = Callable[[Optional[Type[_CData]], _FuncPointer, Tuple[_CData, ...]], _CDa
108108_PF = _UnionT [Tuple [int ], Tuple [int , str ], Tuple [int , str , Any ]]
109109
110110class _FuncPointer (_PointerLike , _CData ):
111- restype : Type [_CData ] | Callable [[int ], Any ] | None = ...
112- argtypes : Sequence [Type [_CData ]] = ...
113- errcheck : _ECT = ...
111+ restype : Type [_CData ] | Callable [[int ], Any ] | None
112+ argtypes : Sequence [Type [_CData ]]
113+ errcheck : _ECT
114114 @overload
115115 def __init__ (self , address : int ) -> None : ...
116116 @overload
@@ -180,8 +180,8 @@ def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ...
180180# ctypes._Pointer in that it is the base class for all pointer types. Unlike the real _Pointer,
181181# it can be instantiated directly (to mimic the behavior of the real pointer function).
182182class pointer (Generic [_CT ], _PointerLike , _CData ):
183- _type_ : ClassVar [Type [_CT ]] = ...
184- contents : _CT = ...
183+ _type_ : ClassVar [Type [_CT ]]
184+ contents : _CT
185185 def __init__ (self , arg : _CT = ...) -> None : ...
186186 @overload
187187 def __getitem__ (self , i : int ) -> _CT : ...
@@ -207,7 +207,7 @@ if sys.platform == "win32":
207207def wstring_at (address : _CVoidConstPLike , size : int = ...) -> str : ...
208208
209209class _SimpleCData (Generic [_T ], _CData ):
210- value : _T = ...
210+ value : _T
211211 def __init__ (self , value : _T = ...) -> None : ...
212212
213213class c_byte (_SimpleCData [int ]): ...
@@ -255,13 +255,13 @@ if sys.platform == "win32":
255255class py_object (_CanCastTo , _SimpleCData [_T ]): ...
256256
257257class _CField :
258- offset : int = ...
259- size : int = ...
258+ offset : int
259+ size : int
260260
261261class _StructUnionMeta (_CDataMeta ):
262- _fields_ : Sequence [Tuple [str , Type [_CData ]] | Tuple [str , Type [_CData ], int ]] = ...
263- _pack_ : int = ...
264- _anonymous_ : Sequence [str ] = ...
262+ _fields_ : Sequence [Tuple [str , Type [_CData ]] | Tuple [str , Type [_CData ], int ]]
263+ _pack_ : int
264+ _anonymous_ : Sequence [str ]
265265 def __getattr__ (self , name : str ) -> _CField : ...
266266
267267class _StructUnionBase (_CData , metaclass = _StructUnionMeta ):
@@ -275,10 +275,10 @@ class BigEndianStructure(Structure): ...
275275class LittleEndianStructure (Structure ): ...
276276
277277class Array (Generic [_CT ], _CData ):
278- _length_ : ClassVar [int ] = ...
279- _type_ : ClassVar [Type [_CT ]] = ...
280- raw : bytes = ... # Note: only available if _CT == c_char
281- value : Any = ... # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise
278+ _length_ : ClassVar [int ]
279+ _type_ : ClassVar [Type [_CT ]]
280+ raw : bytes # Note: only available if _CT == c_char
281+ value : Any # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise
282282 # TODO These methods cannot be annotated correctly at the moment.
283283 # All of these "Any"s stand for the array's element type, but it's not possible to use _CT
284284 # here, because of a special feature of ctypes.
0 commit comments