From a2141882f259e21bb09fa0b7cba8142147b9e3d7 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 7 Jan 2023 23:57:41 -0800 Subject: gh-100776: Fix misleading default value in help(input) (#100788) --- .../Core and Builtins/2023-01-06-02-02-11.gh-issue-100776.pP8xux.rst | 1 + Python/bltinmodule.c | 4 ++-- Python/clinic/bltinmodule.c.h | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-01-06-02-02-11.gh-issue-100776.pP8xux.rst 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]*/ -- cgit v0.12