mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #22615: Argument Clinic now supports the "type" argument for the
int converter. This permits using the int converter with enums and typedefs.
This commit is contained in:
parent
6f3bdc9484
commit
dfbeb160de
5 changed files with 68 additions and 59 deletions
|
@ -2426,11 +2426,13 @@ class int_converter(CConverter):
|
|||
format_unit = 'i'
|
||||
c_ignored_default = "0"
|
||||
|
||||
def converter_init(self, *, types='int'):
|
||||
def converter_init(self, *, types='int', type=None):
|
||||
if types == 'str':
|
||||
self.format_unit = 'C'
|
||||
elif types != 'int':
|
||||
fail("int_converter: illegal 'types' argument")
|
||||
if type != None:
|
||||
self.type = type
|
||||
|
||||
class unsigned_int_converter(CConverter):
|
||||
type = 'unsigned int'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue