Skip to content

Commit a865be0

Browse files
[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 b1e2766)
1 parent 503560d commit a865be0

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎Lib/curses/__init__.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"""
1212

1313
from _curses import *
14+
import _curses
1415
import os as _os
1516
import sys as _sys
1617

@@ -33,6 +34,7 @@ def initscr():
3334
if key.startswith('ACS_') or key in ('LINES', 'COLS'):
3435
setattr(curses, key, value)
3536
return stdscr
37+
initscr.__doc__ = _curses.initscr.__doc__
3638

3739
# This is a similar wrapper for start_color(), which adds the COLORS and
3840
# COLOR_PAIRS variables which are only available after start_color() is
@@ -43,6 +45,7 @@ def start_color():
4345
_curses.start_color()
4446
curses.COLORS = _curses.COLORS
4547
curses.COLOR_PAIRS = _curses.COLOR_PAIRS
48+
start_color.__doc__ = _curses.start_color.__doc__
4649

4750
# Import Python has_key() implementation if _curses doesn't contain has_key()
4851

‎Modules/_cursesmodule.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3913,12 +3913,12 @@ _curses.initscr
39133913
39143914
Initialize the library.
39153915
3916-
Return a WindowObject which represents the whole screen.
3916+
Return a window object which represents the whole screen.
39173917
[clinic start generated code]*/
39183918

39193919
static PyObject *
39203920
_curses_initscr_impl(PyObject *module)
3921-
/*[clinic end generated code: output=619fb68443810b7b input=514f4bce1821f6b5]*/
3921+
/*[clinic end generated code: output=619fb68443810b7b input=e2bf3a061b7d948a]*/
39223922
{
39233923
WINDOW *win;
39243924

‎Modules/clinic/_cursesmodule.c.h‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)