Skip to content

gh-87904: Report the public module name in curses types and exceptions#152341

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-type-names
Jun 27, 2026
Merged

gh-87904: Report the public module name in curses types and exceptions#152341
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-type-names

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

The curses C types and exceptions now set their tp_name to the public module, so __module__, repr() and help() report curses.window, curses.complexchar, curses.complexstr, curses.screen, curses.error, curses.panel.panel and curses.panel.error instead of the underscore extension modules.

This matches the convention already used by decimal.Decimal, collections.deque and sqlite3.Error, and makes the documented public names usable in tracebacks and help(). The types are unchanged objects, still reachable through _curses and _curses_panel.

…eptions

The curses C types and exceptions now set their tp_name to the public
module, so __module__, repr() and help() report curses.window,
curses.complexchar, curses.complexstr, curses.screen, curses.error,
curses.panel.panel and curses.panel.error instead of the underscore
extension modules.  This matches the convention used by decimal.Decimal,
collections.deque and sqlite3.Error.  The types are unchanged objects,
still reachable through the _curses and _curses_panel modules.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka merged commit fd63e21 into python:main Jun 27, 2026
56 checks passed
@serhiy-storchaka serhiy-storchaka deleted the curses-type-names branch June 27, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant