@@ -333,9 +333,13 @@ def __init__(self, name, codes = (), default = None):
333333
334334 if TYPE_CHECKING :
335335 @overload
336- def check_value (self , value : Callable [[], _T ]) -> _T : ...
336+ def check_value (self , value ):
337+ # type: (Callable[[], _T]) -> _T
338+ pass
337339 @overload
338- def check_value (self , value : _T ) -> _T : ...
340+ def check_value (self , value ):
341+ # type: (_T) -> _T
342+ pass
339343 def check_value (self , value ):
340344 # type: (Callable[[], _T] | _T) -> _T
341345 if hasattr (value , self .cast_function ):
@@ -449,12 +453,16 @@ def pack_value(self, val):
449453 return val_bytes + b'\0 ' * ((4 - slen % 4 ) % 4 ), slen , None
450454 else :
451455 return val_bytes , slen , None
456+
452457 if TYPE_CHECKING :
453458 @overload
454- def parse_binary_value (self , data : _T , display : object , length : None , format : object ) -> tuple [_T , Literal [b'' ]]: ...
459+ def parse_binary_value (self , data , display , length , format ):
460+ # type: (_T, object, None, object) -> tuple[_T, Literal[b'']]
461+ pass
455462 @overload
456- def parse_binary_value (self , data : _SliceableBuffer , display : object , length : int , format : object ) -> tuple [_SliceableBuffer , _SliceableBuffer ]: ...
457-
463+ def parse_binary_value (self , data , display , length , format ):
464+ # type: (_SliceableBuffer, object, int, object) -> tuple[_SliceableBuffer, _SliceableBuffer]
465+ pass
458466 def parse_binary_value (self , data , display , length , format ):
459467 # type: (_SliceableBuffer, object, int, object) -> tuple[_SliceableBuffer, _SliceableBuffer]
460468 if length is None :
@@ -491,10 +499,13 @@ def pack_value(self, val):
491499
492500 if TYPE_CHECKING :
493501 @overload
494- def parse_binary_value (self , data : bytes | bytearray , display : object , length : None , format : object ) -> tuple [str , Literal [b'' ]]: ...
502+ def parse_binary_value (self , data , display , length , format ):
503+ # type: (bytes | bytearray, object, None, object) -> tuple[str, Literal[b'']]
504+ pass
495505 @overload
496- def parse_binary_value (self , data : _SliceableBuffer , display : object , length : int , format : object ) -> tuple [str , _SliceableBuffer ]: ...
497-
506+ def parse_binary_value (self , data , display , length , format ):
507+ # type: (_SliceableBuffer, object, int, object) -> tuple[str, _SliceableBuffer]
508+ pass
498509 def parse_binary_value (self , data , display , length , format ):
499510 # type: (bytes | bytearray, object, int, object) -> tuple[str, bytes | bytearray]
500511 if length is None :
@@ -554,7 +565,7 @@ class List(ValueField):
554565 The type of data objects must be provided as an object with the
555566 following attributes and methods:
556567
557- ...
568+ pass
558569
559570 """
560571
@@ -1190,13 +1201,18 @@ def pack_value(self, value):
11901201 # Structs generate their attributes
11911202 # TODO: Complete all classes inheriting from Struct
11921203 # and create a type-only class for all direct instances
1193- def __getattr__ (self , __name : str ) -> Any : ...
1204+ def __getattr__ (self , __name ):
1205+ # type: (str) -> Any
1206+ pass
11941207
11951208 @overload
1196- def parse_value (self , val : _SliceableBuffer , display : display .Display | None , rawdict : Literal [True ]) -> dict [str , Any ]: ...
1209+ def parse_value (self , val , display , rawdict ):
1210+ # type: (_SliceableBuffer, display.Display | None, Literal[True]) -> dict[str, Any]
1211+ pass
11971212 @overload
1198- def parse_value (self , val : _SliceableBuffer , display : display .Display | None , rawdict : Literal [False ] = ...) -> DictWrapper :...
1199-
1213+ def parse_value (self , val , display , rawdict = False ):
1214+ # type: (_SliceableBuffer, display.Display | None, Literal[False]) -> DictWrapper
1215+ pass
12001216 def parse_value (self , val , display , rawdict = 0 ):
12011217 # type: (_SliceableBuffer, display.Display | None, bool) -> dict[str, Any] | DictWrapper
12021218
@@ -1243,9 +1259,13 @@ def parse_value(self, val, display, rawdict = 0):
12431259
12441260 if TYPE_CHECKING :
12451261 @overload
1246- def parse_binary (self , data : _SliceableBuffer , display : display .Display | None , rawdict : Literal [True ]) -> tuple [dict [str , Any ], _SliceableBuffer ]: ...
1262+ def parse_binary (self , data , display , rawdict ):
1263+ # type: (_SliceableBuffer, display.Display | None, Literal[True]) -> tuple[dict[str, Any], _SliceableBuffer]
1264+ pass
12471265 @overload
1248- def parse_binary (self , data : _SliceableBuffer , display : display .Display | None , rawdict : Literal [False ] = ...) -> tuple [DictWrapper , _SliceableBuffer ]:...
1266+ def parse_binary (self , data , display , rawdict = False ):
1267+ # type: (_SliceableBuffer, display.Display | None, Literal[False]) -> tuple[DictWrapper , _SliceableBuffer]
1268+ pass
12491269 def parse_binary (self , data , display , rawdict = 0 ):
12501270 # type: (_SliceableBuffer, display.Display | None, bool) -> tuple[DictWrapper | dict[str, Any], _SliceableBuffer]
12511271
@@ -1417,7 +1437,9 @@ def __getattr__(self, attr):
14171437 except KeyError :
14181438 raise AttributeError (attr )
14191439 if TYPE_CHECKING :
1420- def __setattr__ (self , __name : str , __value : Any ) -> None : ...
1440+ def __setattr__ (self , __name , __value ):
1441+ # type: (str, Any) -> None
1442+ pass
14211443
14221444class DictWrapper (GetAttrData ):
14231445 def __init__ (self , dict ):
0 commit comments