gh-156234: Fix and rewrite the curses documentation on reading - #156235
Conversation
Fix wrong types: instr() and getstr() return a bytes object, not a str, and their n limits the number of bytes; getkey() returns a str; unctrl() returns a bytes object. Make clear whether an integer standing for a character is an encoded byte or a character code. Rewrite the documentation of getch(), get_wch(), getkey(), getstr(), get_wstr(), instr(), in_wstr() and in_wchstr(), following X/Open Curses.
Documentation build overview
|
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
|
GH-156279 is a backport of this pull request to the 3.15 branch. |
|
GH-156280 is a backport of this pull request to the 3.14 branch. |
|
GH-156281 is a backport of this pull request to the 3.13 branch. |
…GH-156235) (GH-156281) Fix wrong types: instr() and getstr() return a bytes object, not a str, and their n limits the number of bytes; getkey() returns a str; unctrl() returns a bytes object. Make clear whether an integer standing for a character is an encoded byte or a character code. Rewrite the documentation of getch(), get_wch(), getkey(), getstr() and instr(), following X/Open Curses. The docstrings of getstr() and instr() said that n defaults to 2047, while the limit on this branch is 1023. (cherry picked from commit be87bfa)
…GH-156235) (GH-156280) Fix wrong types: instr() and getstr() return a bytes object, not a str, and their n limits the number of bytes; getkey() returns a str; unctrl() returns a bytes object. Make clear whether an integer standing for a character is an encoded byte or a character code. Rewrite the documentation of getch(), get_wch(), getkey(), getstr() and instr(), following X/Open Curses. (cherry picked from commit be87bfa)
|
|
Fix wrong types:
instr()andgetstr()return a bytes object, not a str, and their n limits the number of bytes;getkey()returns astr;unctrl()returns a bytes object. Make clear whether an integer standing for a character is an encoded byte or a character code.Rewrite the documentation of
getch(),get_wch(),getkey(),getstr(),get_wstr(),instr(),in_wstr()andin_wchstr(), following X/Open Curses.