]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-100776: Fix misleading default value in help(input) (GH-100788) (#100841)
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>
Sun, 8 Jan 2023 09:23:12 +0000 (01:23 -0800)
committerGitHub <noreply@github.com>
Sun, 8 Jan 2023 09:23:12 +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 94a7819c252e56c8dc02dd49fa9f133425354258..a3fdb394a13680b50d9ed255fa66588a32fa2fc5 100644 (file)
@@ -2065,7 +2065,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.
@@ -2079,7 +2079,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(
index 5d9a16a7b682270ee9d41f7d8b6031f70d517a62..10cd6c820bccfc921dd4cc7eb5eac0e5a50821c2 100644 (file)
@@ -843,7 +843,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"
@@ -1045,4 +1045,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=cc844ea007c1241f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c45d5fe414f7a8d7 input=a9049054013a1b77]*/