@@ -2957,7 +2957,7 @@ def parser_name(self):
2957
2957
2958
2958
class bool_converter (CConverter ):
2959
2959
type : str = 'int'
2960
- default_type = bool
2960
+ default_type : bltns . type [ bool ] = bool
2961
2961
format_unit : str = 'p'
2962
2962
c_ignored_default : str = '0'
2963
2963
@@ -3008,7 +3008,7 @@ def set_template_dict(self, template_dict):
3008
3008
3009
3009
class char_converter (CConverter ):
3010
3010
type : str = 'char'
3011
- default_type = (bytes , bytearray )
3011
+ default_type : tuple [ bltns . type [ bytes ], bltns . type [ bytearray ]] = (bytes , bytearray )
3012
3012
format_unit : str = 'c'
3013
3013
c_ignored_default : str = "'\0 '"
3014
3014
@@ -3042,7 +3042,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3042
3042
@add_legacy_c_converter ('B' , bitwise = True )
3043
3043
class unsigned_char_converter (CConverter ):
3044
3044
type : str = 'unsigned char'
3045
- default_type = int
3045
+ default_type : bltns . type [ int ] = int
3046
3046
format_unit : str = 'b'
3047
3047
c_ignored_default : str = "'\0 '"
3048
3048
@@ -3091,7 +3091,7 @@ class byte_converter(unsigned_char_converter): pass
3091
3091
3092
3092
class short_converter (CConverter ):
3093
3093
type : str = 'short'
3094
- default_type = int
3094
+ default_type : bltns . type [ int ] = int
3095
3095
format_unit : str = 'h'
3096
3096
c_ignored_default : str = "0"
3097
3097
@@ -3122,7 +3122,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3122
3122
3123
3123
class unsigned_short_converter (CConverter ):
3124
3124
type : str = 'unsigned short'
3125
- default_type = int
3125
+ default_type : bltns . type [ int ] = int
3126
3126
c_ignored_default : str = "0"
3127
3127
3128
3128
def converter_init (self , * , bitwise : bool = False ) -> None :
@@ -3144,7 +3144,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3144
3144
@add_legacy_c_converter ('C' , accept = {str })
3145
3145
class int_converter (CConverter ):
3146
3146
type : str = 'int'
3147
- default_type = int
3147
+ default_type : bltns . type [ int ] = int
3148
3148
format_unit : str = 'i'
3149
3149
c_ignored_default : str = "0"
3150
3150
@@ -3184,7 +3184,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3184
3184
3185
3185
class unsigned_int_converter (CConverter ):
3186
3186
type : str = 'unsigned int'
3187
- default_type = int
3187
+ default_type : bltns . type [ int ] = int
3188
3188
c_ignored_default : str = "0"
3189
3189
3190
3190
def converter_init (self , * , bitwise : bool = False ) -> None :
@@ -3205,7 +3205,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3205
3205
3206
3206
class long_converter (CConverter ):
3207
3207
type : str = 'long'
3208
- default_type = int
3208
+ default_type : bltns . type [ int ] = int
3209
3209
format_unit : str = 'l'
3210
3210
c_ignored_default : str = "0"
3211
3211
@@ -3221,7 +3221,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3221
3221
3222
3222
class unsigned_long_converter (CConverter ):
3223
3223
type : str = 'unsigned long'
3224
- default_type = int
3224
+ default_type : bltns . type [ int ] = int
3225
3225
c_ignored_default : str = "0"
3226
3226
3227
3227
def converter_init (self , * , bitwise : bool = False ) -> None :
@@ -3244,7 +3244,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3244
3244
3245
3245
class long_long_converter (CConverter ):
3246
3246
type : str = 'long long'
3247
- default_type = int
3247
+ default_type : bltns . type [ int ] = int
3248
3248
format_unit : str = 'L'
3249
3249
c_ignored_default : str = "0"
3250
3250
@@ -3260,7 +3260,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3260
3260
3261
3261
class unsigned_long_long_converter (CConverter ):
3262
3262
type : str = 'unsigned long long'
3263
- default_type = int
3263
+ default_type : bltns . type [ int ] = int
3264
3264
c_ignored_default : str = "0"
3265
3265
3266
3266
def converter_init (self , * , bitwise : bool = False ) -> None :
@@ -3355,7 +3355,7 @@ def _parse_arg(self, argname: str, displayname: str) -> str:
3355
3355
3356
3356
class float_converter (CConverter ):
3357
3357
type : str = 'float'
3358
- default_type = float
3358
+ default_type : bltns . type [ float ] = float
3359
3359
format_unit : str = 'f'
3360
3360
c_ignored_default : str = "0.0"
3361
3361
@@ -3377,7 +3377,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3377
3377
3378
3378
class double_converter (CConverter ):
3379
3379
type : str = 'double'
3380
- default_type = float
3380
+ default_type : bltns . type [ float ] = float
3381
3381
format_unit : str = 'd'
3382
3382
c_ignored_default : str = "0.0"
3383
3383
@@ -3400,7 +3400,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3400
3400
3401
3401
class Py_complex_converter (CConverter ):
3402
3402
type : str = 'Py_complex'
3403
- default_type = complex
3403
+ default_type : bltns . type [ complex ] = complex
3404
3404
format_unit : str = 'D'
3405
3405
c_ignored_default : str = "{0.0, 0.0}"
3406
3406
@@ -3691,7 +3691,7 @@ def parse_arg(self, argname: str, argnum: str) -> str:
3691
3691
class Py_buffer_converter (CConverter ):
3692
3692
type : str = 'Py_buffer'
3693
3693
format_unit : str = 'y*'
3694
- impl_by_reference = True
3694
+ impl_by_reference : bool = True
3695
3695
c_ignored_default : str = "{NULL, NULL}"
3696
3696
3697
3697
def converter_init (self , * , accept = {buffer }) -> None :
@@ -3789,7 +3789,7 @@ class self_converter(CConverter):
3789
3789
A special-case converter:
3790
3790
this is the default converter used for "self".
3791
3791
"""
3792
- type = None
3792
+ type : str | None = None
3793
3793
format_unit : str = ''
3794
3794
3795
3795
def converter_init (self , * , type = None ) -> None :
0 commit comments