| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…rray methods Add the immutable curses.complexstr type, an array of styled wide-character cells -- the string counterpart of complexchar. It is constructible from an iterable of cells (each a complexchar or a str) or from a string split into cells, with optional attr and pair applied to every cell. It is an immutable sequence (indexing yields a complexchar, slicing and concatenation yield a complexstr), is hashable, and str() returns its cells' text. Add the window method in_wchstr(), the wide-character counterpart of instr() and in_wstr() that keeps each cell's attributes and color pair instead of stripping them; it returns a complexstr. The methods addstr(), addnstr(), insstr() and insnstr() now also accept a complexstr, so a run read with in_wchstr() can be written back unchanged. The cells carry their own rendition, so combining one with an explicit attr raises TypeError. This is the second step of the cchar_t API (cell arrays), after the single-cell complexchar type. Co-Authored-By: Claude Opus 4.8 <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 |
Add the immutable curses.complexstr type, an array of styled wide-character cells -- the string counterpart of complexchar (as str is to a single character). It is constructible from an iterable of cells (each a complexchar or a str) or from a string split into cells, with optional attr and pair applied to every cell. It is an immutable sequence (indexing yields a complexchar, slicing and concatenation yield a complexstr), is hashable, and str() returns its cells' text.
Add the window method in_wchstr(), the wide-character counterpart of instr() and in_wstr() that keeps each cell's attributes and color pair instead of stripping them; it returns a complexstr.
The methods addstr(), addnstr(), insstr() and insnstr() now also accept a complexstr, so a run read with in_wchstr() can be written back unchanged. The cells carry their own rendition, so combining one with an explicit attr raises TypeError.
This is the second and final part of the cchar_t API (gh-152233); the first (GH-152250) added the single-cell complexchar type.