]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] gh-100776: Fix misleading default value in help(input) (GH-100788) (#100842)
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>
Sun, 8 Jan 2023 09:23:34 +0000 (01:23 -0800)
committerGitHub <noreply@github.com>
Sun, 8 Jan 2023 09:23:34 +0000 (01:23 -0800)
(cherry picked from commit a2141882f259e21bb09fa0b7cba8142147b9e3d7)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Misc/NEWS.d/next/Core and Builtins/2023-01-06-02-02-11.gh-issue-100776.pP8xux.rst [new file with mode: 0644]
Python/bltinmodule.c
Python/clinic/bltinmodule.c.h

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 (file)
index 0000000..b94121e
--- /dev/null
@@ -0,0 +1 @@
+Fix misleading default value in :func:`input`'s ``__text_signature__``.
index b0162e5e87217a7d0bea0d5399a50214cfc2c1a3..659b78edc3de43d43b7b10184eb36b7bc11a0608 100644 (file)
@@ -2034,7 +2034,7 @@ flush: whether to forcibly flush the stream.");
 /*[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.
@@ -2048,7 +2048,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]*/
 {
     PyObject *fin = _PySys_GetObjectId(&PyId_stdin);
     PyObject *fout = _PySys_GetObjectId(&PyId_stdout);
index 545f5b53f6e54952634e161f322ba1f09948e657..6f547921c7e9491e2e71d1dbbaa27dde566353ce 100644 (file)
@@ -672,7 +672,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"
@@ -874,4 +874,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=da9ae459e9233259 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b5c1a7a1621b7cca input=a9049054013a1b77]*/