https://github.com/python/cpython/commit/a865be0177d7a92d00ec23da6bc6b9b6d229b94a
commit: a865be0177d7a92d00ec23da6bc6b9b6d229b94a
branch: 3.15
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-10-09T18:37:21Z
summary:
[3.15] gh-157546: Add missing docstrings in curses (GH-157547) (GH-157903)
The Python wrappers initscr() and start_color() now use the docstrings
of the wrapped C functions.
(cherry picked from commit b1e2766ad6d9dfcb35bc37917484354f8cff9ea6)
files:
M Lib/curses/__init__.py
M Modules/_cursesmodule.c
M Modules/clinic/_cursesmodule.c.h
diff --git a/Lib/curses/__init__.py b/Lib/curses/__init__.py
index 605d5fcbec5499d..c22a552bd41b6fa 100644
--- a/Lib/curses/__init__.py
+++ b/Lib/curses/__init__.py
@@ -11,6 +11,7 @@
"""
from _curses import *
+import _curses
import os as _os
import sys as _sys
@@ -33,6 +34,7 @@ def initscr():
if key.startswith('ACS_') or key in ('LINES', 'COLS'):
setattr(curses, key, value)
return stdscr
+initscr.__doc__ = _curses.initscr.__doc__
# This is a similar wrapper for start_color(), which adds the COLORS and
# COLOR_PAIRS variables which are only available after start_color() is
@@ -43,6 +45,7 @@ def start_color():
_curses.start_color()
curses.COLORS = _curses.COLORS
curses.COLOR_PAIRS = _curses.COLOR_PAIRS
+start_color.__doc__ = _curses.start_color.__doc__
# Import Python has_key() implementation if _curses doesn't contain has_key()
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 80914b21e273839..f2afd60b1fc9a74 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -3913,12 +3913,12 @@ _curses.initscr
Initialize the library.
-Return a WindowObject which represents the whole screen.
+Return a window object which represents the whole screen.
[clinic start generated code]*/
static PyObject *
_curses_initscr_impl(PyObject *module)
-/*[clinic end generated code: output=619fb68443810b7b input=514f4bce1821f6b5]*/
+/*[clinic end generated code: output=619fb68443810b7b input=e2bf3a061b7d948a]*/
{
WINDOW *win;
diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h
index ddc491f0d4a5b4c..0476d80de0066c4 100644
--- a/Modules/clinic/_cursesmodule.c.h
+++ b/Modules/clinic/_cursesmodule.c.h
@@ -2692,7 +2692,7 @@ PyDoc_STRVAR(_curses_initscr__doc__,
"\n"
"Initialize the library.\n"
"\n"
-"Return a WindowObject which represents the whole screen.");
+"Return a window object which represents the whole screen.");
#define _CURSES_INITSCR_METHODDEF \
{"initscr", (PyCFunction)_curses_initscr, METH_NOARGS,
_curses_initscr__doc__},
@@ -4498,4 +4498,4 @@ _curses_has_extended_color_support(PyObject *module,
PyObject *Py_UNUSED(ignored
#ifndef _CURSES_ASSUME_DEFAULT_COLORS_METHODDEF
#define _CURSES_ASSUME_DEFAULT_COLORS_METHODDEF
#endif /* !defined(_CURSES_ASSUME_DEFAULT_COLORS_METHODDEF) */
-/*[clinic end generated code: output=07421e6c7add461e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c353112ab3690d04 input=a9049054013a1b77]*/
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]