You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Accept curses.complexchar in curses.ascii predicates and conversions #153395
This is a follow-up of gh-151757, which added wide-character support and the curses.complexchar character-cell type.
That type cannot currently be passed to the curses.ascii functions, so code that reads a cell -- for example via curses.window.in_wch() -- and wants to classify it with curses.ascii has to unwrap it by hand first.
The membership predicates (isalpha(), isdigit(), isprint(), iscntrl(), ...) and the ctrl() and unctrl() conversions should also accept a complexchar, classifying it by its single character. A cell that holds combining characters is not a single character, so the predicates return false for it.
While there, ctrl() should be a no-op for a non-ASCII argument. There is no control character outside ASCII, and masking the code to 0x1f (as it does now) just yields an unrelated control byte.
ascii(), alt() and ismeta() remain meaningless for non-8-bit codes, a complexchar included.
Activity
gh-153395: Accept curses.complexchar in curses.ascii predicates and c…
gh-153395: Fix test_complexchar on narrow curses builds (GH-154005)