Repository navigation
Conversation
halfdelay() does not raise on timeout, getch() returns -1; termname() is not truncated to 14 characters; scroll() raises curses.error rather than doing nothing without scrollok(); insnstr() inserts nothing for n == 0, not the whole string; and insch(y, x, ch) moves the cursor.
Documentation build overview
168 files changed ·
|
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Good catch. There are inaccuracies for halfdelay() and termname(), all other looks fine.
Please try to avoid reflow to minimize the diff. If this is unavoidable, prefer to use semantic line breaks (break paragraph between sentences) -- this can minimize future diffs.
| blocking for *tenths* tenths of seconds, raise an exception if nothing has | ||
| been typed. The value of *tenths* must be a number between ``1`` and ``255``. Use | ||
| :func:`nocbreak` to leave half-delay mode. | ||
| blocking for *tenths* tenths of seconds, :meth:`~window.getch` returns ``-1`` |
There was a problem hiding this comment.
The old sentence was not wrong for every reader -- on a timeout get_wch() and getkey() do raise an exception, and only getch() returns -1. Please mention both.
|
|
||
| Return the value of the environment variable :envvar:`TERM`, as a bytes object, | ||
| truncated to 14 characters. | ||
| Return the value of the environment variable :envvar:`TERM`, as a bytes |
There was a problem hiding this comment.
- Some curses libraries truncate it to 14 characters.
- It is not just the value of the environment variable TERM, it is the name passed to setupterm() etc (according to the X/Open curses specification).
Return the name of the terminal in use, as a bytes object.
This is the name passed to :func:`initscr`, :func:`newterm` or
:func:`setupterm`, or the value of the :envvar:`TERM` environment variable
if none was given. Some curses libraries truncate it to 14 characters.There was a problem hiding this comment.
Thanks, applied your wording.
halfdelay() now says that getkey() and get_wch() raise while getch() returns -1; termname() describes the name of the terminal in use rather than TERM alone, and keeps the 14-character note as a library-dependent caveat; the touched paragraphs use semantic line breaks so that no line is reflowed needlessly.
| Return the value of the environment variable :envvar:`TERM`, as a bytes object, | ||
| truncated to 14 characters. | ||
| Return the name of the terminal in use, as a bytes object. | ||
| This is the name passed to :func:`initscr`, :func:`newterm` or |
There was a problem hiding this comment.
Actually, initscr() take no terminal name. Drop it.
Five statements in
Doc/library/curses.rstdescribe behaviour the module does not have:halfdelay()does not makegetch()raise on timeout,termname()is not truncated to 14 characters,window.scroll()raisescurses.errorrather than doing nothing withoutscrollok(),window.insnstr()inserts nothing forn == 0, and thewindow.insch(y, x, ch)form moves the cursor. Each was measured on a pty; theinschandinsnstrwording now matchesinsstr, which already gets it right.