From: Larry Hastings Date: Sun, 19 Jan 2014 05:54:15 +0000 (-0800) Subject: Issue #20299: Argument Clinic custom converters may now change the default X-Git-Tag: v3.4.0b3~96 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b470575e2492349584d9afa2a9d581b58ee92c38;p=thirdparty%2FPython%2Fcpython.git Issue #20299: Argument Clinic custom converters may now change the default value of c_default and py_default with a class member. --- diff --git a/Misc/NEWS b/Misc/NEWS index b97f4f8cd25c..b66ae0b8a402 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -101,6 +101,9 @@ Tests Tools/Demos ----------- +- Issue #20299: Argument Clinic custom converters may now change the default + value of c_default and py_default with a class member. + - Issue #20287: Argument Clinic's output is now configurable, allowing delaying its output or even redirecting it to a separate file. diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 0987d568bd65..ba0bc174ce21 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -1893,8 +1893,10 @@ class CConverter(metaclass=CConverterAutoRegister): self.__class__.__name__, default, name, types_str)) self.default = default - self.c_default = c_default - self.py_default = py_default + if c_default: + self.c_default = c_default + if py_default: + self.py_default = py_default if annotation != unspecified: fail("The 'annotation' parameter is not currently permitted.")