8000 Also add types to 'default_type' · python/cpython@dd1c773 · GitHub
[go: up one dir, main page]

Skip to content

Commit dd1c773

Browse files
Also add types to 'default_type'
1 parent 8191183 commit dd1c773

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Tools/clinic/clinic.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,7 +2957,7 @@ def parser_name(self):
29572957

29582958
class bool_converter(CConverter):
29592959
type: str = 'int'
2960-
default_type = bool
2960+
default_type: bltns.type[bool] = bool
29612961
format_unit: str = 'p'
29622962
c_ignored_default: str = '0'
29632963

@@ -3008,7 +3008,7 @@ def set_template_dict(self, template_dict):
30083008

30093009
class char_converter(CConverter):
30103010
type: str = 'char'
3011-
default_type = (bytes, bytearray)
3011+
default_type: tuple[bltns.type[bytes], bltns.type[bytearray]] = (bytes, bytearray)
30123012
format_unit: str = 'c'
30133013
c_ignored_default: str = "'\0'"
30143014

@@ -3042,7 +3042,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
30423042
@add_legacy_c_converter('B', bitwise=True)
30433043
class unsigned_char_converter(CConverter):
30443044
type: str = 'unsigned char'
3045-
default_type = int
3045+
default_type: bltns.type[int] = int
30463046
format_unit: str = 'b'
30473047
c_ignored_default: str = "'\0'"
30483048

@@ -3091,7 +3091,7 @@ class byte_converter(unsigned_char_converter): pass
30913091

30923092
class short_converter(CConverter):
30933093
type: str = 'short'
3094-
default_type = int
3094+
default_type: bltns.type[int] = int
30953095
format_unit: str = 'h'
30963096
c_ignored_default: str = "0"
30973097

@@ -3122,7 +3122,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
31223122

31233123
class unsigned_short_converter(CConverter):
31243124
type: str = 'unsigned short'
3125-
default_type = int
3125+
default_type: bltns.type[int] = int
31263126
c_ignored_default: str = "0"
31273127

31283128
def converter_init(self, *, bitwise: bool = False) -> None:
@@ -3144,7 +3144,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
31443144
@add_legacy_c_converter('C', accept={str})
31453145
class int_converter(CConverter):
31463146
type: str = 'int'
3147-
default_type = int
3147+
default_type: bltns.type[int] = int
31483148
format_unit: str = 'i'
31493149
c_ignored_default: str = "0"
31503150

@@ -3184,7 +3184,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
31843184

31853185
class unsigned_int_converter(CConverter):
31863186
type: str = 'unsigned int'
3187-
default_type = int
3187+
default_type: bltns.type[int] = int
31883188
c_ignored_default: str = "0"
31893189

31903190
def converter_init(self, *, bitwise: bool = False) -> None:
@@ -3205,7 +3205,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
32053205

32063206
class long_converter(CConverter):
32073207
type: str = 'long'
3208-
default_type = int
3208+
default_type: bltns.type[int] = int
32093209
format_unit: str = 'l'
32103210
c_ignored_default: str = "0"
32113211

@@ -3221,7 +3221,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
32213221

32223222
class unsigned_long_converter(CConverter):
32233223
type: str = 'unsigned long'
3224-
default_type = int
3224+
default_type: bltns.type[int] = int
32253225
c_ignored_default: str = "0"
32263226

32273227
def converter_init(self, *, bitwise: bool = False) -> None:
@@ -3244,7 +3244,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
32443244

32453245
class long_long_converter(CConverter):
32463246
type: str = 'long long'
3247-
default_type = int
3247+
default_type: bltns.type[int] = int
32483248
format_unit: str = 'L'
32493249
c_ignored_default: str = "0"
32503250

@@ -3260,7 +3260,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
32603260

32613261
class unsigned_long_long_converter(CConverter):
32623262
type: str = 'unsigned long long'
3263-
default_type = int
3263+
default_type: bltns.type[int] = int
32643264
c_ignored_default: str = "0"
32653265

32663266
def converter_init(self, *, bitwise: bool = False) -> None:
@@ -3355,7 +3355,7 @@ def _parse_arg(self, argname: str, displayname: str) -> str:
33553355

33563356
class float_converter(CConverter):
33573357
type: str = 'float'
3358-
default_type = float
3358+
default_type: bltns.type[float] = float
33593359
format_unit: str = 'f'
33603360
c_ignored_default: str = "0.0"
33613361

@@ -3377,7 +3377,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
33773377

33783378
class double_converter(CConverter):
33793379
type: str = 'double'
3380-
default_type = float
3380+
default_type: bltns.type[float] = float
33813381
format_unit: str = 'd'
33823382
c_ignored_default: str = "0.0"
33833383

@@ -3400,7 +3400,7 @@ def parse_arg(self, argname: str, displayname: str) -> str:
34003400

34013401
class Py_complex_converter(CConverter):
34023402
type: str = 'Py_complex'
3403-
default_type = complex
3403+
default_type: bltns.type[complex] = complex
34043404
format_unit: str = 'D'
34053405
c_ignored_default: str = "{0.0, 0.0}"
34063406

@@ -3691,7 +3691,7 @@ def parse_arg(self, argname: str, argnum: str) -> str:
36913691
class Py_buffer_converter(CConverter):
36923692
type: str = 'Py_buffer'
36933693
format_unit: str = 'y*'
3694-
impl_by_reference = True
3694+
impl_by_reference: bool = True
36953695
c_ignored_default: str = "{NULL, NULL}"
36963696

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

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

0 commit comments

Comments
 (0)
0