11import sys
22import types
3- from _typeshed import Incomplete , ReadableBuffer , WriteableBuffer
3+ from _typeshed import ReadableBuffer , WriteableBuffer
44from collections .abc import Callable , Hashable
5- from typing import Any , ClassVar , Literal , Optional , Protocol , Self , SupportsIndex , TypeVar , final , overload , type_check_only
5+ from typing import Any , ClassVar , Literal , Protocol , SupportsIndex , TypeVar , final , overload , type_check_only
66from typing_extensions import Self , TypeAlias , disjoint_base
77
88_T = TypeVar ("_T" )
@@ -27,11 +27,11 @@ if sys.platform != "win32":
2727
2828@final
2929class CField :
30- bitshift : int
31- bitsize : int
32- flags : int
33- offset : int
34- type : 'CType'
30+ bitshift : int
31+ bitsize : int
32+ flags : int
33+ offset : int
34+ type : 'CType'
3535
3636@final
3737class CLibrary :
@@ -45,18 +45,18 @@ class CType:
4545 cname : str
4646 kind : Literal ['enum' , 'primitive' , 'pointer' , 'array' , 'void' , 'struct' , 'union' , 'function' ]
4747
48- abi : int
49- args : tuple ['CType' , ...]
50- ellipsis : bool
51- result : 'CType'
48+ abi : int
49+ args : tuple ['CType' , ...]
50+ ellipsis : bool
51+ result : 'CType'
5252
5353 item : 'CType'
54- length : Optional [ int ]
54+ length : int | None
5555
56- fields : Optional [ list [tuple [str , CField ]]]
56+ fields : list [tuple [str , CField ]] | None
5757
58- relements : dict [str , int ]
59- elements : dict [int , str ]
58+ relements : dict [str , int ]
59+ elements : dict [int , str ]
6060
6161@final
6262class Lib :
@@ -99,18 +99,18 @@ class _CDataBase:
9999
100100@final
101101class buffer :
102- __hash__ : ClassVar [None ] # type: ignore[assignment]
103- def __new__ (cls , cdata : _CDataBase , size : int = - 1 ) -> Self : ...
104- def __buffer__ (self , flags : int , / ) -> memoryview : ...
105- def __eq__ (self , other : ReadableBuffer , / ) -> bool : ...
106- def __ne__ (self , other : ReadableBuffer , / ) -> bool : ...
107- def __ge__ (self , other : ReadableBuffer , / ) -> bool : ...
108- def __gt__ (self , other : ReadableBuffer , / ) -> bool : ...
109- def __le__ (self , other : ReadableBuffer , / ) -> bool : ...
110- def __lt__ (self , other : ReadableBuffer , / ) -> bool : ...
111- def __len__ (self ) -> int : ...
112- def __getitem__ (self , index : SupportsIndex | slice , / ) -> bytes : ...
113- def __setitem__ (self , index : SupportsIndex | slice , value : bytes , / ) -> None : ...
102+ __hash__ : ClassVar [None ] # type: ignore[assignment]
103+ def __new__ (cls , cdata : _CDataBase , size : int = - 1 ) -> Self : ...
104+ def __buffer__ (self , flags : int , / ) -> memoryview : ...
105+ def __eq__ (self , other : ReadableBuffer , / ) -> bool : ...
106+ def __ne__ (self , other : ReadableBuffer , / ) -> bool : ...
107+ def __ge__ (self , other : ReadableBuffer , / ) -> bool : ...
108+ def __gt__ (self , other : ReadableBuffer , / ) -> bool : ...
109+ def __le__ (self , other : ReadableBuffer , / ) -> bool : ...
110+ def __lt__ (self , other : ReadableBuffer , / ) -> bool : ...
111+ def __len__ (self ) -> int : ...
112+ def __getitem__ (self , index : SupportsIndex | slice , / ) -> bytes : ...
113+ def __setitem__ (self , index : SupportsIndex | slice , value : bytes , / ) -> None : ...
114114
115115# These aliases are to work around pyright complaints.
116116# Pyright doesn't like it when a class object is defined as an alias
0 commit comments