]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107008: Document the curses module variables LINES and COLS (GH-107011)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 22 Jul 2023 16:54:50 +0000 (19:54 +0300)
committerGitHub <noreply@github.com>
Sat, 22 Jul 2023 16:54:50 +0000 (19:54 +0300)
LINES and COLS referred in curses.update_lines_cols() documentations are
the module variables, not the environment variables.

Doc/library/curses.rst
Doc/whatsnew/3.5.rst
Misc/NEWS.d/next/Documentation/2023-07-22-15-14-13.gh-issue-107008.3JQ1Vt.rst [new file with mode: 0644]

index cf208f3ba0db360b186847b8893a7359efbdb420..391c81a844d3e081ae47e515d57d1e9b16580e66 100644 (file)
@@ -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.
index 262e4ed32c0a3b4fa11858e4fe9ae0073ac1beba..66610fa70efe9e8e16de6956f24eafda1955c86a 100644 (file)
@@ -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 (file)
index 0000000..a0fa27e
--- /dev/null
@@ -0,0 +1,2 @@
+Document the :mod:`curses` module variables :const:`~curses.LINES` and
+:const:`~curses.COLS`.