summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>2023-01-08 07:57:41 (GMT)
committerGitHub <noreply@github.com>2023-01-08 07:57:41 (GMT)
commita2141882f259e21bb09fa0b7cba8142147b9e3d7 (patch)
treefd707dd28e9e4a848c8a77aa0d6b1d91e9374fe1
parentdf3851fe4ab8c9013aeb5dfd75d6e8edf2ece9a8 (diff)
downloadcpython-a2141882f259e21bb09fa0b7cba8142147b9e3d7.zip
cpython-a2141882f259e21bb09fa0b7cba8142147b9e3d7.tar.gz
cpython-a2141882f259e21bb09fa0b7cba8142147b9e3d7.tar.bz2
gh-100776: Fix misleading default value in help(input) (#100788)
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2023-01-06-02-02-11.gh-issue-100776.pP8xux.rst1
-rw-r--r--Python/bltinmodule.c4
-rw-r--r--Python/clinic/bltinmodule.c.h4
3 files changed, 5 insertions, 4 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-01-06-02-02-11.gh-issue-100776.pP8xux.rst b/Misc/NEWS.d/next/Core and Builtins/2023-01-06-02-02-11.gh-issue-100776.pP8xux.rst
new file mode 100644
index 0000000..b94121e
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2023-01-06-02-02-11.gh-issue-100776.pP8xux.rst
@@ -0,0 +1 @@
+Fix misleading default value in :func:`input`'s ``__text_signature__``.
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 9ebe4c8..599cc18 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2063,7 +2063,7 @@ builtin_print_impl(PyObject *module, PyObject *args, PyObject *sep,
/*[clinic input]
input as builtin_input
- prompt: object(c_default="NULL") = None
+ prompt: object(c_default="NULL") = ""
/
Read a string from standard input. The trailing newline is stripped.
@@ -2077,7 +2077,7 @@ On *nix systems, readline is used if available.
static PyObject *
builtin_input_impl(PyObject *module, PyObject *prompt)
-/*[clinic end generated code: output=83db5a191e7a0d60 input=5e8bb70c2908fe3c]*/
+/*[clinic end generated code: output=83db5a191e7a0d60 input=159c46d4ae40977e]*/
{
PyThreadState *tstate = _PyThreadState_GET();
PyObject *fin = _PySys_GetAttr(
diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h
index baf9555..b77b4a1 100644
--- a/Python/clinic/bltinmodule.c.h
+++ b/Python/clinic/bltinmodule.c.h
@@ -1126,7 +1126,7 @@ exit:
}
PyDoc_STRVAR(builtin_input__doc__,
-"input($module, prompt=None, /)\n"
+"input($module, prompt=\'\', /)\n"
"--\n"
"\n"
"Read a string from standard input. The trailing newline is stripped.\n"
@@ -1409,4 +1409,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=0a6a8efe82cf8b81 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=84a04e7446debf58 input=a9049054013a1b77]*/