[Python-checkins] [3.11] gh-107008: Document the curses module variables LINES and COLS (GH-107011) (GH-107058)

serhiy-storchaka webhook-mailer at python.org
Sat Jul 22 14:13:41 EDT 2023


https://github.com/python/cpython/commit/e5d2a19ac5ad9d1130d778c960c4b966c32cac72
commit: e5d2a19ac5ad9d1130d778c960c4b966c32cac72
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2023-07-22T21:13:38+03:00
summary:

[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 26e08dfdd7ac1b3d567d30cd35e4898121580390)

Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>

files:
A Misc/NEWS.d/next/Documentation/2023-07-22-15-14-13.gh-issue-107008.3JQ1Vt.rst
M Doc/library/curses.rst
M Doc/whatsnew/3.5.rst

diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst
index 44dd9d32f148e..e0bc462fb1c95 100644
--- a/Doc/library/curses.rst
+++ b/Doc/library/curses.rst
@@ -644,7 +644,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
 
@@ -1345,10 +1346,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 23d2f6562aab8..69d9147524cae 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`.)
 
 
diff --git a/Misc/NEWS.d/next/Documentation/2023-07-22-15-14-13.gh-issue-107008.3JQ1Vt.rst b/Misc/NEWS.d/next/Documentation/2023-07-22-15-14-13.gh-issue-107008.3JQ1Vt.rst
new file mode 100644
index 0000000000000..a0fa27ec10303
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2023-07-22-15-14-13.gh-issue-107008.3JQ1Vt.rst
@@ -0,0 +1,2 @@
+Document the :mod:`curses` module variables :const:`~curses.LINES` and
+:const:`~curses.COLS`.



More information about the Python-checkins mailing list