10000 Remove annotations of simple assignments · python/cpython@bdc130d · GitHub
[go: up one dir, main page]

Skip to content

Commit bdc130d

Browse files
Remove annotations of simple assignments
1 parent dd1c773 commit bdc130d

File tree

1 file changed

+80
-80
lines changed

1 file changed

+80
-80
lines changed

Tools/clinic/clinic.py

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,10 +2956,10 @@ def parser_name(self):
29562956

29572957

29582958
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'
29632963

29642964
def converter_init(self, *, accept={object}):
29652965
if accept == {int}:
@@ -2992,9 +2992,9 @@ class defining_class_converter(CConverter):
29922992
A special-case converter:
29932993
this is the default converter used for the defining class.
29942994
"""
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
29982998

29992999
def converter_init(self, *, type=None) -> None:
30003000
self.specified_type = type
@@ -3007,10 +3007,10 @@ def set_template_dict(self, template_dict):
30073007

30083008

30093009
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'"
30143014

30153015
def converter_init(self) -> None:
30163016
if isinstance(self.default, self.default_type):
@@ -3041,10 +3041,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
30413041

30423042
@add_legacy_c_converter('B', bitwise=True)
30433043
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'"
30483048

30493049
def converter_init(self, *, bitwise=False) -> None:
30503050
if bitwise:
@@ -3090,10 +3090,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
30903090
class byte_converter(unsigned_char_converter): pass
30913091

30923092
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"
30973097

30983098
def parse_arg(self, argname: str, displayname: str) -> str:
30993099
if self.format_unit == 'h':
@@ -3121,9 +3121,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
31213121
return super().parse_arg(argname, displayname)
31223122

31233123
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"
31273127

31283128
def converter_init(self, *, bitwise: bool = False) -> None:
31293129
if bitwise:
@@ -3143,10 +3143,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
31433143

31443144
@add_legacy_c_converter('C', accept={str})
31453145
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"
31503150

31513151
def converter_init(self, *, accept={int}, type=None) -> None:
31523152
if accept == {str}:
@@ -3183,9 +3183,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
31833183
return super().parse_arg(argname, displayname)
31843184

31853185
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"
31893189

31903190
def converter_init(self, *, bitwise: bool = False) -> None:
31913191
if bitwise:
@@ -3204,10 +3204,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
32043204
return super().parse_arg(argname, displayname)
32053205

32063206
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"
32113211

32123212
def parse_arg(self, argname: str, displayname: str) -> str:
32133213
if self.format_unit == 'l':
@@ -3220,9 +3220,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
32203220
return super().parse_arg(argname, displayname)
32213221

32223222
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"
32263226

32273227
def converter_init(self, *, bitwise: bool = False) -> None:
32283228
if bitwise:
@@ -3243,10 +3243,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
32433243
return super().parse_arg(argname, displayname)
32443244

32453245
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"
32503250

32513251
def parse_arg(self, argname: str, displayname: str) -> str:
32523252
if self.format_unit == 'L':
@@ -3259,9 +3259,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
32593259
return super().parse_arg(argname, displayname)
32603260

32613261
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"
32653265

32663266
def converter_init(self, *, bitwise: bool = False) -> None:
32673267
if bitwise:
@@ -3282,8 +3282,8 @@ def parse_arg(self, argname: str, displayname: str) -> str:
32823282
return super().parse_arg(argname, displayname)
32833283

32843284
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"
32873287

32883288
def converter_init(self, *, accept={int}) -> None:
32893289
if accept == {int}:
@@ -3314,7 +3314,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
33143314

33153315

33163316
class slice_index_converter(CConverter):
3317-
type: str = 'Py_ssize_t'
3317+
type = 'Py_ssize_t'
33183318

33193319
def converter_init(self, *, accept={int, NoneType}) -> None:
33203320
if accept == {int}:
@@ -3325,9 +3325,9 @@ def converter_init(self, *, accept={int, NoneType}) -> None:
33253325
fail("slice_index_converter: illegal 'accept' argument " + repr(accept))
33263326

33273327
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"
33313331

33323332
def parse_arg(self, argname: str, displayname: str) -> str:
33333333
if self.format_unit == 'n':
@@ -3341,8 +3341,8 @@ def parse_arg(self, argname: str, displayname: str) -> str:
33413341

33423342

33433343
class fildes_converter(CConverter):
3344-
type: str = 'int'
3345-
converter: str = '_PyLong_FileDescriptor_Converter'
3344+
type = 'int'
3345+
converter = '_PyLong_FileDescriptor_Converter'
33463346

33473347
def _parse_arg(self, argname: str, displayname: str) -> str:
33483348
return """
@@ -3354,10 +3354,10 @@ def _parse_arg(self, argname: str, displayname: str) -> str:
33543354

33553355

33563356
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"
33613361

33623362
def parse_arg(self, argname: str, displayname: str) -> str:
33633363
if self.format_unit == 'f':
@@ -3376,10 +3376,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
33763376
return super().parse_arg(argname, displayname)
33773377

33783378
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"
33833383

33843384
def parse_arg(self, argname: str, displayname: str) -> str:
33853385
if self.format_unit == 'd':
@@ -3399,10 +3399,10 @@ def parse_arg(self, argname: str, displayname: str) -> str:
33993399

34003400

34013401
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}"
34063406

34073407
def parse_arg(self, argname: str, displayname: str) -> str:
34083408
if self.format_unit == 'D':
@@ -3416,8 +3416,8 @@ def parse_arg(self, argname: str, displayname: str) -> str:
34163416

34173417

34183418
class object_converter(CConverter):
3419-
type: str = 'PyObject *'
3420-
format_unit: str = 'O'
3419+
type = 'PyObject *'
3420+
format_unit = 'O'
34213421

34223422
def converter_init(self, *, converter=None, type=None, subclass_of=None):
34233423
if converter:
@@ -3451,9 +3451,9 @@ def str_converter_key(types, encoding, zeroes):
34513451
str_converter_argument_map: dict[str, str] = {}
34523452

34533453
class str_converter(CConverter):
3454-
type: str = 'const char *'
3454+
type = 'const char *'
34553455
default_type = (str, Null, NoneType)
3456-
format_unit: str = 's'
3456+
format_unit = 's'
34573457

34583458
def converter_init(self, *, accept={str}, encoding=None, zeroes=False):
34593459

@@ -3571,8 +3571,8 @@ def r(format_unit, *, accept, encoding=False, zeroes=False):
35713571

35723572

35733573
class PyBytesObject_converter(CConverter):
3574-
type: str = 'PyBytesObject *'
3575-
format_unit: str = 'S'
3574+
type = 'PyBytesObject *'
3575+
format_unit = 'S'
35763576
# accept = {bytes}
35773577

35783578
def parse_arg(self, argname: str, displayname: str) -> str:
@@ -3588,8 +3588,8 @@ def parse_arg(self, argname: str, displayname: str) -> str:
35883588
return super().parse_arg(argname, displayname)
35893589

35903590
class PyByteArrayObject_converter(CConverter):
3591-
type: str = 'PyByteArrayObject *'
3592-
format_unit: str = 'Y'
3591+
type = 'PyByteArrayObject *'
3592+
format_unit = 'Y'
35933593
# accept = {bytearray}
35943594

35953595
def parse_arg(self, argname: str, displayname: str) -> str:
@@ -3605,9 +3605,9 @@ def parse_arg(self, argname: str, displayname: str) -> str:
36053605
return super().parse_arg(argname, displayname)
36063606

36073607
class unicode_converter(CConverter):
3 10000 608-
type: str = 'PyObject *'
3608+
type = 'PyObject *'
36093609
default_type = (str, Null, NoneType)
3610-
format_unit: str = 'U'
3610+
format_unit = 'U'
36113611

36123612
def parse_arg(self, argname: str, displayname: str) -> str:
36133613
if self.format_unit == 'U':
@@ -3629,7 +3629,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
36293629
@add_legacy_c_converter('Z', accept={str, NoneType})
36303630
@add_legacy_c_converter('Z#', accept={str, NoneType}, zeroes=True)
36313631
class Py_UNICODE_converter(CConverter):
3632-
type: str = 'const Py_UNICODE *'
3632+
type = 'const Py_UNICODE *'
36333633
default_type = (str, Null, NoneType)
36343634

36353635
def converter_init(self, *, accept={str}, zeroes: bool = False) -> None:
@@ -3689,10 +3689,10 @@ def parse_arg(self, argname: str, argnum: str) -> str:
36893689
@add_legacy_c_converter('z*', accept={str, buffer, NoneType})
36903690
@add_legacy_c_converter('w*', accept={rwbuffer})
36913691
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}"
36963696

36973697
def converter_init(self, *, accept={buffer}) -> None:
36983698
if self.default not in (unspecified, None):
@@ -3789,8 +3789,8 @@ class self_converter(CConverter):
37893789
A special-case converter:
37903790
this is the default converter used for "self".
37913791
"""
3792-
type: str | None = None
3793-
format_unit: str = ''
3792+
type = None
3793+
format_unit = ''
37943794

37953795
def converter_init(self, *, type=None) -> None:
37963796
self.specified_type = type

0 commit comments

Comments
 (0)
0