summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-01-07 19:53:01 (GMT)
committerLarry Hastings <larry@hastings.org>2014-01-07 19:53:01 (GMT)
commit16c5191ab3443aa5c1f835848514f94c696a8c4d (patch)
treea064b4a173dddc48b34bc48b95601809c3bf9ba7 /Modules/_testcapimodule.c
parent0bce6e746274980fb934ee8f2a06cbf8f8a54e3e (diff)
downloadcpython-16c5191ab3443aa5c1f835848514f94c696a8c4d.zip
cpython-16c5191ab3443aa5c1f835848514f94c696a8c4d.tar.gz
cpython-16c5191ab3443aa5c1f835848514f94c696a8c4d.tar.bz2
Issue #20144: Argument Clinic now supports simple constants as parameter
default values. inspect.Signature correspondingly supports them in __text_signature__ fields for builtins.
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index a0cffde..b8fe8d5 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -2869,6 +2869,15 @@ PyDoc_STRVAR(docstring_with_signature_and_extra_newlines,
"This docstring has a valid signature and some extra newlines."
);
+PyDoc_STRVAR(docstring_with_signature_with_defaults,
+"docstring_with_signature_with_defaults(s='avocado', d=3.14, i=35, c=sys.maxsize, n=None, t=True, f=False)\n"
+"\n"
+"\n"
+"\n"
+"This docstring has a valid signature with parameters,\n"
+"and the parameters take defaults of varying types."
+);
+
#ifdef WITH_THREAD
typedef struct {
PyThread_type_lock start_event;
@@ -3087,6 +3096,9 @@ static PyMethodDef TestMethods[] = {
{"docstring_with_signature_and_extra_newlines",
(PyCFunction)test_with_docstring, METH_NOARGS,
docstring_with_signature_and_extra_newlines},
+ {"docstring_with_signature_with_defaults",
+ (PyCFunction)test_with_docstring, METH_NOARGS,
+ docstring_with_signature_with_defaults},
#ifdef WITH_THREAD
{"call_in_temporary_c_thread", call_in_temporary_c_thread, METH_O,
PyDoc_STR("set_error_class(error_class) -> None")},