summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-07-22 16:54:50 (GMT)
committerGitHub <noreply@github.com>2023-07-22 16:54:50 (GMT)
commit26e08dfdd7ac1b3d567d30cd35e4898121580390 (patch)
treec7d6a0bcef333968cc1e0a81224cda3493847152 /Doc
parent6fbc717214210e06313a283b2f3ec8ce67209609 (diff)
downloadcpython-26e08dfdd7ac1b3d567d30cd35e4898121580390.zip
cpython-26e08dfdd7ac1b3d567d30cd35e4898121580390.tar.gz
cpython-26e08dfdd7ac1b3d567d30cd35e4898121580390.tar.bz2
gh-107008: Document the curses module variables LINES and COLS (GH-107011)
LINES and COLS referred in curses.update_lines_cols() documentations are the module variables, not the environment variables.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/curses.rst20
-rw-r--r--Doc/whatsnew/3.5.rst4
2 files changed, 21 insertions, 3 deletions
diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst
index cf208f3..391c81a 100644
--- a/Doc/library/curses.rst
+++ b/Doc/library/curses.rst
@@ -641,7 +641,8 @@ The module :mod:`curses` defines the following functions:
.. function:: update_lines_cols()
- Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual screen resize.
+ Update the :const:`LINES` and :const:`COLS` module variables.
+ Useful for detecting manual screen resize.
.. versionadded:: 3.5
@@ -1342,10 +1343,27 @@ The :mod:`curses` module defines the following data members:
.. data:: COLORS
The maximum number of colors the terminal can support.
+ It is defined only after the call to :func:`start_color`.
.. data:: COLOR_PAIRS
The maximum number of color pairs the terminal can support.
+ It is defined only after the call to :func:`start_color`.
+
+.. data:: COLS
+
+ The width of the screen, i.e., the number of columns.
+ It is defined only after the call to :func:`initscr`.
+ Updated by :func:`update_lines_cols`, :func:`resizeterm` and
+ :func:`resize_term`.
+
+.. data:: LINES
+
+ The height of the screen, i.e., the number of lines.
+ It is defined only after the call to :func:`initscr`.
+ Updated by :func:`update_lines_cols`, :func:`resizeterm` and
+ :func:`resize_term`.
+
Some constants are available to specify character cell attributes.
The exact constants available are system dependent.
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst
index 262e4ed..66610fa 100644
--- a/Doc/whatsnew/3.5.rst
+++ b/Doc/whatsnew/3.5.rst
@@ -1045,8 +1045,8 @@ not just sequences. (Contributed by Serhiy Storchaka in :issue:`23171`.)
curses
------
-The new :func:`~curses.update_lines_cols` function updates the :envvar:`LINES`
-and :envvar:`COLS` environment variables. This is useful for detecting
+The new :func:`~curses.update_lines_cols` function updates the :data:`LINES`
+and :data:`COLS` module variables. This is useful for detecting
manual screen resizing. (Contributed by Arnon Yaari in :issue:`4254`.)