| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…module The character-cell window methods now accept a full character cell -- a spacing character optionally followed by combining characters (up to CCHARW_MAX wide characters) -- in addition to a single int or byte character. This affects addch(), bkgd(), bkgdset(), border(), box(), echochar(), hline(), insch() and vline(); they dispatch to the ncursesw wide-character functions (wadd_wch(), wbkgrnd(), wborder_set(), wecho_wchar(), whline_set(), wins_wch(), wvline_set(), ...) when given a string. border() and box() cannot mix integer or byte characters with wide string characters in a single call. A cell is one spacing character optionally followed by combining characters, so an extra spacing or control character (such as "ab") is rejected with ValueError rather than being silently truncated by setcchar(). Also add the wide-character read methods get_wstr() and in_wstr(), the counterparts of getstr() and instr() that return a str rather than a bytes object, and the module functions erasewchar(), killwchar() and wunctrl(), the wide-character counterparts of erasechar(), killchar() and unctrl(). All of this is available only when built against the wide-character ncursesw library. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Documentation build overview3 files changed ± library/curses.html ± whatsnew/3.16.html ± whatsnew/changelog.html |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The character-cell window methods now accept a full character cell -- a spacing character optionally followed by combining characters (up to CCHARW_MAX wide characters) -- in addition to a single int or byte character. This affects addch(), bkgd(), bkgdset(), border(), box(), echochar(), hline(), insch() and vline(), which dispatch to the ncursesw wide-character functions (wadd_wch(), wbkgrnd(), wborder_set(), wecho_wchar(), whline_set(), wins_wch(), wvline_set(), ...) when given a string. border() and box() cannot mix integer or byte characters with wide-string characters in a single call.
A cell is one spacing character optionally followed by combining characters, so an extra spacing or control character (for example "ab", an emoji ZWJ sequence, or an emoji with a skin-tone modifier) is rejected with ValueError rather than being silently truncated by setcchar(). A single control character is still accepted (curses applies its usual control processing, e.g. backspace, tab and carriage return).
Also added are the wide-character read methods window.get_wstr() and window.in_wstr(), the counterparts of window.getstr() and window.instr() that return a str rather than bytes, and the module functions curses.erasewchar(), curses.killwchar() and curses.wunctrl(), the wide-character counterparts of curses.erasechar(), curses.killchar() and curses.unctrl().
All of this is available only when built against the wide-character ncursesw library.
🤖 Generated with Claude Code