Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify public name of curses.window #87904

Open
rmccampbell7 mannequin opened this issue Apr 5, 2021 · 2 comments
Open

Clarify public name of curses.window #87904

rmccampbell7 mannequin opened this issue Apr 5, 2021 · 2 comments
Labels
3.9 only security fixes 3.10 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@rmccampbell7
Copy link
Mannequin

rmccampbell7 mannequin commented Apr 5, 2021

BPO 43738
Nosy @serhiy-storchaka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-04-05.23:37:41.319>
labels = ['type-feature', '3.9', '3.10', 'docs']
title = 'Clarify public name of curses.window'
updated_at = <Date 2021-04-06.07:44:00.293>
user = 'https://bugs.python.org/rmccampbell7'

bugs.python.org fields:

activity = <Date 2021-04-06.07:44:00.293>
actor = 'serhiy.storchaka'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2021-04-05.23:37:41.319>
creator = 'rmccampbell7'
dependencies = []
files = []
hgrepos = []
issue_num = 43738
keywords = []
message_count = 2.0
messages = ['390266', '390289']
nosy_count = 3.0
nosy_names = ['docs@python', 'serhiy.storchaka', 'rmccampbell7']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue43738'
versions = ['Python 3.9', 'Python 3.10']

@rmccampbell7
Copy link
Mannequin Author

rmccampbell7 mannequin commented Apr 5, 2021

Until 3.8 the curses window class was not directly available in code, but now it is available as _curses.window. This is not explicitly stated in the documentation (although it is consistent with how the method signatures are written). It is useful to have a public name for the type to aid IDE's with explicit type annotations, i.e.

@curses.wrapper
def main(stdscr: curses.window):
    stdscr.addstr(...)

See python/typeshed#5180, which adds this name to type hints in the typeshed project.

This name should be more clearly documented so programmers can annotate the type without worrying that it may change (which will cause a runtime error unless it is quoted).

@rmccampbell7 rmccampbell7 mannequin added 3.9 only security fixes 3.10 only security fixes labels Apr 5, 2021
@rmccampbell7 rmccampbell7 mannequin assigned docspython Apr 5, 2021
@rmccampbell7 rmccampbell7 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement 3.9 only security fixes 3.10 only security fixes labels Apr 5, 2021
@rmccampbell7 rmccampbell7 mannequin assigned docspython Apr 5, 2021
@rmccampbell7 rmccampbell7 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Apr 5, 2021
@serhiy-storchaka
Copy link
Member

It could help also in help().

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.9 only security fixes 3.10 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
Projects
Status: Features
Development

No branches or pull requests

1 participant