Skip to content

Commit e5d2a19

Browse files
[3.11] gh-107008: Document the curses module variables LINES and COLS (GH-107011) (GH-107058)
LINES and COLS referred in curses.update_lines_cols() documentations are the module variables, not the environment variables. (cherry picked from commit 26e08df) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 63c945a commit e5d2a19

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

Doc/library/curses.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,8 @@ The module :mod:`curses` defines the following functions:
644644

645645
.. function:: update_lines_cols()
646646

647-
Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual screen resize.
647+
Update the :const:`LINES` and :const:`COLS` module variables.
648+
Useful for detecting manual screen resize.
648649

649650
.. versionadded:: 3.5
650651

@@ -1345,10 +1346,27 @@ The :mod:`curses` module defines the following data members:
13451346
.. data:: COLORS
13461347

13471348
The maximum number of colors the terminal can support.
1349+
It is defined only after the call to :func:`start_color`.
13481350

13491351
.. data:: COLOR_PAIRS
13501352

13511353
The maximum number of color pairs the terminal can support.
1354+
It is defined only after the call to :func:`start_color`.
1355+
1356+
.. data:: COLS
1357+
1358+
The width of the screen, i.e., the number of columns.
1359+
It is defined only after the call to :func:`initscr`.
1360+
Updated by :func:`update_lines_cols`, :func:`resizeterm` and
1361+
:func:`resize_term`.
1362+
1363+
.. data:: LINES
1364+
1365+
The height of the screen, i.e., the number of lines.
1366+
It is defined only after the call to :func:`initscr`.
1367+
Updated by :func:`update_lines_cols`, :func:`resizeterm` and
1368+
:func:`resize_term`.
1369+
13521370

13531371
Some constants are available to specify character cell attributes.
13541372
The exact constants available are system dependent.

Doc/whatsnew/3.5.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,8 +1045,8 @@ not just sequences. (Contributed by Serhiy Storchaka in :issue:`23171`.)
10451045
curses
10461046
------
10471047

1048-
The new :func:`~curses.update_lines_cols` function updates the :envvar:`LINES`
1049-
and :envvar:`COLS` environment variables. This is useful for detecting
1048+
The new :func:`~curses.update_lines_cols` function updates the :data:`LINES`
1049+
and :data:`COLS` module variables. This is useful for detecting
10501050
manual screen resizing. (Contributed by Arnon Yaari in :issue:`4254`.)
10511051

10521052

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Document the :mod:`curses` module variables :const:`~curses.LINES` and
2+
:const:`~curses.COLS`.

0 commit comments

Comments
 (0)