Skip to content

[3.13] gh-156234: Fix and rewrite the curses documentation on reading (GH-156235) - #156281

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-156235-3.13
Aug 23, 2026
Merged

[3.13] gh-156234: Fix and rewrite the curses documentation on reading (GH-156235)#156281
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-156235-3.13

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 23, 2026

Copy link
Copy Markdown
Member

Manual backport of #156235.

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 parts for in_wstr(), in_wchstr(), get_wstr(), wunctrl() and complexchar/complexstr are omitted: these do not exist in 3.13. The limit is 1023 here, not 2047; the docstrings of getstr() and instr() claimed n=2047, which is fixed too.

(cherry picked from commit be87bfa)

…eading (pythonGH-156235)

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)
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) August 23, 2026 12:12
@serhiy-storchaka
serhiy-storchaka merged commit 2eb7ed5 into python:3.13 Aug 23, 2026
46 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Aug 23, 2026
@serhiy-storchaka
serhiy-storchaka deleted the backport-156235-3.13 branch August 27, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant