Skip to content

Commit 3889d39

Browse files
[3.12] gh-107008: Document the curses module variables LINES and COLS (GH-107011) (GH-107057)
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 844bdce commit 3889d39

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
@@ -641,7 +641,8 @@ The module :mod:`curses` defines the following functions:
641641

642642
.. function:: update_lines_cols()
643643

644-
Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual screen resize.
644+
Update the :const:`LINES` and :const:`COLS` module variables.
645+
Useful for detecting manual screen resize.
645646

646647
.. versionadded:: 3.5
647648

@@ -1342,10 +1343,27 @@ The :mod:`curses` module defines the following data members:
13421343
.. data:: COLORS
13431344

13441345
The maximum number of colors the terminal can support.
1346+
It is defined only after the call to :func:`start_color`.
13451347

13461348
.. data:: COLOR_PAIRS
13471349

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

13501368
Some constants are available to specify character cell attributes.
13511369
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)