@@ -2956,10 +2956,10 @@ def parser_name(self):
2956
2956
2957
2957
2958
2958
class bool_converter (CConverter ):
2959
- type : str = 'int'
2960
- default_type : bltns . type [ bool ] = bool
2961
- format_unit : str = 'p'
2962
- c_ignored_default : str = '0'
2959
+ type = 'int'
2960
+ default_type = bool
2961
+ format_unit = 'p'
2962
+ c_ignored_default = '0'
2963
2963
2964
2964
def converter_init (self , * , accept = {object }):
2965
2965
if accept == {int }:
@@ -2992,9 +2992,9 @@ class defining_class_converter(CConverter):
2992
2992
A special-case converter:
2993
2993
this is the default converter used for the defining class.
2994
2994
"""
2995
- type : str = 'PyTypeObject *'
2996
- format_unit : str = ''
2997
- show_in_signature : bool = False
2995
+ type = 'PyTypeObject *'
2996
+ format_unit = ''
2997
+ show_in_signature = False
2998
2998
2999
2999
def converter_init (self , * , type = None ) -> None :
3000
3000
self .specified_type = type
@@ -3007,10 +3007,10 @@ def set_template_dict(self, template_dict):
3007
3007
3008
3008
3009
3009
class char_converter (CConverter ):
3010
- type : str = 'char'
3011
- default_type : tuple [ bltns . type [ bytes ], bltns . type [ bytearray ]] = (bytes , bytearray )
3012
- format_unit : str = 'c'
3013
- c_ignored_default : str = "'\0 '"
3010
+ type = 'char'
3011
+ default_type = (bytes , bytearray )
3012
+ format_unit = 'c'
3013
+ c_ignored_default = "'\0 '"
3014
3014
3015
3015
def converter_init (self ) -> None :
3016
3016
if isinstance (self .default , self .default_type ):
@@ -3041,10 +3041,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3041
3041
3042
3042
@add_legacy_c_converter ('B' , bitwise = True )
3043
3043
class unsigned_char_converter (CConverter ):
3044
- type : str = 'unsigned char'
3045
- default_type : bltns . type [ int ] = int
3046
- format_unit : str = 'b'
3047
- c_ignored_default : str = "'\0 '"
3044
+ type = 'unsigned char'
3045
+ default_type = int
3046
+ format_unit = 'b'
3047
+ c_ignored_default = "'\0 '"
3048
3048
3049
3049
def converter_init (self , * , bitwise = False ) -> None :
3050
3050
if bitwise :
@@ -3090,10 +3090,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3090
3090
class byte_converter (unsigned_char_converter ): pass
3091
3091
3092
3092
class short_converter (CConverter ):
3093
- type : str = 'short'
3094
- default_type : bltns . type [ int ] = int
3095
- format_unit : str = 'h'
3096
- c_ignored_default : str = "0"
3093
+ type = 'short'
3094
+ default_type = int
3095
+ format_unit = 'h'
3096
+ c_ignored_default = "0"
3097
3097
3098
3098
def parse_arg (self , argname : str , displayname : str ) -> str :
3099
3099
if self .format_unit == 'h' :
@@ -3121,9 +3121,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3121
3121
return super ().parse_arg (argname , displayname )
3122
3122
3123
3123
class unsigned_short_converter (CConverter ):
3124
- type : str = 'unsigned short'
3125
- default_type : bltns . type [ int ] = int
3126
- c_ignored_default : str = "0"
3124
+ type = 'unsigned short'
3125
+ default_type = int
3126
+ c_ignored_default = "0"
3127
3127
3128
3128
def converter_init (self , * , bitwise : bool = False ) -> None :
3129
3129
if bitwise :
@@ -3143,10 +3143,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3143
3143
3144
3144
@add_legacy_c_converter ('C' , accept = {str })
3145
3145
class int_converter (CConverter ):
3146
- type : str = 'int'
3147
- default_type : bltns . type [ int ] = int
3148
- format_unit : str = 'i'
3149
- c_ignored_default : str = "0"
3146
+ type = 'int'
3147
+ default_type = int
3148
+ format_unit = 'i'
3149
+ c_ignored_default = "0"
3150
3150
3151
3151
def converter_init (self , * , accept = {int }, type = None ) -> None :
3152
3152
if accept == {str }:
@@ -3183,9 +3183,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3183
3183
return super ().parse_arg (argname , displayname )
3184
3184
3185
3185
class unsigned_int_converter (CConverter ):
3186
- type : str = 'unsigned int'
3187
- default_type : bltns . type [ int ] = int
3188
- c_ignored_default : str = "0"
3186
+ type = 'unsigned int'
3187
+ default_type = int
3188
+ c_ignored_default = "0"
3189
3189
3190
3190
def converter_init (self , * , bitwise : bool = False ) -> None :
3191
3191
if bitwise :
@@ -3204,10 +3204,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3204
3204
return super ().parse_arg (argname , displayname )
3205
3205
3206
3206
class long_converter (CConverter ):
3207
- type : str = 'long'
3208
- default_type : bltns . type [ int ] = int
3209
- format_unit : str = 'l'
3210
- c_ignored_default : str = "0"
3207
+ type = 'long'
3208
+ default_type = int
3209
+ format_unit = 'l'
3210
+ c_ignored_default = "0"
3211
3211
3212
3212
def parse_arg (self , argname : str , displayname : str ) -> str :
3213
3213
if self .format_unit == 'l' :
@@ -3220,9 +3220,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3220
3220
return super ().parse_arg (argname , displayname )
3221
3221
3222
3222
class unsigned_long_converter (CConverter ):
3223
- type : str = 'unsigned long'
3224
- default_type : bltns . type [ int ] = int
3225
- c_ignored_default : str = "0"
3223
+ type = 'unsigned long'
3224
+ default_type = int
3225
+ c_ignored_default = "0"
3226
3226
3227
3227
def converter_init (self , * , bitwise : bool = False ) -> None :
3228
3228
if bitwise :
@@ -3243,10 +3243,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3243
3243
return super ().parse_arg (argname , displayname )
3244
3244
3245
3245
class long_long_converter (CConverter ):
3246
- type : str = 'long long'
3247
- default_type : bltns . type [ int ] = int
3248
- format_unit : str = 'L'
3249
- c_ignored_default : str = "0"
3246
+ type = 'long long'
3247
+ default_type = int
3248
+ format_unit = 'L'
3249
+ c_ignored_default = "0"
3250
3250
3251
3251
def parse_arg (self , argname : str , displayname : str ) -> str :
3252
3252
if self .format_unit == 'L' :
@@ -3259,9 +3259,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3259
3259
return super ().parse_arg (argname , displayname )
3260
3260
3261
3261
class unsigned_long_long_converter (CConverter ):
3262
- type : str = 'unsigned long long'
3263
- default_type : bltns . type [ int ] = int
3264
- c_ignored_default : str = "0"
3262
+ type = 'unsigned long long'
3263
+ default_type = int
3264
+ c_ignored_default = "0"
3265
3265
3266
3266
def converter_init (self , * , bitwise : bool = False ) -> None :
3267
3267
if bitwise :
@@ -3282,8 +3282,8 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3282
3282
return super ().parse_arg (argname , displayname )
3283
3283
3284
3284
class Py_ssize_t_converter (CConverter ):
3285
- type : str = 'Py_ssize_t'
3286
- c_ignored_default : str = "0"
3285
+ type = 'Py_ssize_t'
3286
+ c_ignored_default = "0"
3287
3287
3288
3288
def converter_init (self , * , accept = {int }) -> None :
3289
3289
if accept == {int }:
@@ -3314,7 +3314,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3314
3314
3315
3315
3316
3316
class slice_index_converter (CConverter ):
3317
- type : str = 'Py_ssize_t'
3317
+ type = 'Py_ssize_t'
3318
3318
3319
3319
def converter_init (self , * , accept = {int , NoneType }) -> None :
3320
3320
if accept == {int }:
@@ -3325,9 +3325,9 @@ def converter_init(self, *, accept={int, NoneType}) -> None:
3325
3325
fail ("slice_index_converter: illegal 'accept' argument " + repr (accept ))
3326
3326
3327
3327
class size_t_converter (CConverter ):
3328
- type : str = 'size_t'
3329
- converter : str = '_PyLong_Size_t_Converter'
3330
- c_ignored_default : str = "0"
3328
+ type = 'size_t'
3329
+ converter = '_PyLong_Size_t_Converter'
3330
+ c_ignored_default = "0"
3331
3331
3332
3332
def parse_arg (self , argname : str , displayname : str ) -> str :
3333
3333
if self .format_unit == 'n' :
@@ -3341,8 +3341,8 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3341
3341
3342
3342
3343
3343
class fildes_converter (CConverter ):
3344
- type : str = 'int'
3345
- converter : str = '_PyLong_FileDescriptor_Converter'
3344
+ type = 'int'
3345
+ converter = '_PyLong_FileDescriptor_Converter'
3346
3346
3347
3347
def _parse_arg (self , argname : str , displayname : str ) -> str :
3348
3348
return """
@@ -3354,10 +3354,10 @@ def _parse_arg(self, argname: str, displayname: str) -> str:
3354
3354
3355
3355
3356
3356
class float_converter (CConverter ):
3357
- type : str = 'float'
3358
- default_type : bltns . type [ float ] = float
3359
- format_unit : str = 'f'
3360
- c_ignored_default : str = "0.0"
3357
+ type = 'float'
3358
+ default_type = float
3359
+ format_unit = 'f'
3360
+ c_ignored_default = "0.0"
3361
3361
3362
3362
def parse_arg (self , argname : str , displayname : str ) -> str :
3363
3363
if self .format_unit == 'f' :
@@ -3376,10 +3376,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3376
3376
return super ().parse_arg (argname , displayname )
3377
3377
3378
3378
class double_converter (CConverter ):
3379
- type : str = 'double'
3380
- default_type : bltns . type [ float ] = float
3381
- format_unit : str = 'd'
3382
- c_ignored_default : str = "0.0"
3379
+ type = 'double'
3380
+ default_type = float
3381
+ format_unit = 'd'
3382
+ c_ignored_default = "0.0"
3383
3383
3384
3384
def parse_arg (self , argname : str , displayname : str ) -> str :
3385
3385
if self .format_unit == 'd' :
@@ -3399,10 +3399,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3399
3399
3400
3400
3401
3401
class Py_complex_converter (CConverter ):
3402
- type : str = 'Py_complex'
3403
- default_type : bltns . type [ complex ] = complex
3404
- format_unit : str = 'D'
3405
- c_ignored_default : str = "{0.0, 0.0}"
3402
+ type = 'Py_complex'
3403
+ default_type = complex
3404
+ format_unit = 'D'
3405
+ c_ignored_default = "{0.0, 0.0}"
3406
3406
3407
3407
def parse_arg (self , argname : str , displayname : str ) -> str :
3408
3408
if self .format_unit == 'D' :
@@ -3416,8 +3416,8 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3416
3416
3417
3417
3418
3418
class object_converter (CConverter ):
3419
- type : str = 'PyObject *'
3420
- format_unit : str = 'O'
3419
+ type = 'PyObject *'
3420
+ format_unit = 'O'
3421
3421
3422
3422
def converter_init (self , * , converter = None , type = None , subclass_of = None ):
3423
3423
if converter :
@@ -3451,9 +3451,9 @@ def str_converter_key(types, encoding, zeroes):
3451
3451
str_converter_argument_map : dict [str , str ] = {}
3452
3452
3453
3453
class str_converter (CConverter ):
3454
- type : str = 'const char *'
3454
+ type = 'const char *'
3455
3455
default_type = (str , Null , NoneType )
3456
- format_unit : str = 's'
3456
+ format_unit = 's'
3457
3457
3458
3458
def converter_init (self , * , accept = {str }, encoding = None , zeroes = False ):
3459
3459
@@ -3571,8 +3571,8 @@ def r(format_unit, *, accept, encoding=False, zeroes=False):
3571
3571
3572
3572
3573
3573
class PyBytesObject_converter (CConverter ):
3574
- type : str = 'PyBytesObject *'
3575
- format_unit : str = 'S'
3574
+ type = 'PyBytesObject *'
3575
+ format_unit = 'S'
3576
3576
# accept = {bytes}
3577
3577
3578
3578
def parse_arg (self , argname : str , displayname : str ) -> str :
@@ -3588,8 +3588,8 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3588
3588
return super ().parse_arg (argname , displayname )
3589
3589
3590
3590
class PyByteArrayObject_converter (CConverter ):
3591
- type : str = 'PyByteArrayObject *'
3592
- format_unit : str = 'Y'
3591
+ type = 'PyByteArrayObject *'
3592
+ format_unit = 'Y'
3593
3593
# accept = {bytearray}
3594
3594
3595
3595
def parse_arg (self , argname : str , displayname : str ) -> str :
@@ -3605,9 +3605,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3605
3605
return super ().parse_arg (argname , displayname )
3606
3606
3607
3607
class unicode_converter (CConverter ):
3
10000
608
- type : str = 'PyObject *'
3608
+ type = 'PyObject *'
3609
3609
default_type = (str , Null , NoneType )
3610
- format_unit : str = 'U'
3610
+ format_unit = 'U'
3611
3611
3612
3612
def parse_arg (self , argname : str , displayname : str ) -> str :
3613
3613
if self .format_unit == 'U' :
@@ -3629,7 +3629,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
3629
3629
@add_legacy_c_converter ('Z' , accept = {str , NoneType })
3630
3630
@add_legacy_c_converter ('Z#' , accept = {str , NoneType }, zeroes = True )
3631
3631
class Py_UNICODE_converter (CConverter ):
3632
- type : str = 'const Py_UNICODE *'
3632
+ type = 'const Py_UNICODE *'
3633
3633
default_type = (str , Null , NoneType )
3634
3634
3635
3635
def converter_init (self , * , accept = {str }, zeroes : bool = False ) -> None :
@@ -3689,10 +3689,10 @@ def parse_arg(self, argname: str, argnum: str) -> str:
3689
3689
@add_legacy_c_converter ('z*' , accept = {str , buffer , NoneType })
3690
3690
@add_legacy_c_converter ('w*' , accept = {rwbuffer })
3691
3691
class Py_buffer_converter (CConverter ):
3692
- type : str = 'Py_buffer'
3693
- format_unit : str = 'y*'
3694
- impl_by_reference : bool = True
3695
- c_ignored_default : str = "{NULL, NULL}"
3692
+ type = 'Py_buffer'
3693
+ format_unit = 'y*'
3694
+ impl_by_reference = True
3695
+ c_ignored_default = "{NULL, NULL}"
3696
3696
3697
3697
def converter_init (self , * , accept = {buffer }) -> None :
3698
3698
if self .default not in (unspecified , None ):
@@ -3789,8 +3789,8 @@ class self_converter(CConverter):
3789
3789
A special-case converter:
3790
3790
this is the default converter used for "self".
3791
3791
"""
3792
- type : str | None = None
3793
- format_unit : str = ''
3792
+ type = None
3793
+ format_unit = ''
3794
3794
3795
3795
def converter_init (self , * , type = None ) -> None :
3796
3796
self .specified_type = type
0 commit comments