New submission from Ryan McCampbell <rmccampbe...@gmail.com>:

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 https://github.com/python/typeshed/pull/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).

----------
assignee: docs@python
components: Documentation
messages: 390266
nosy: docs@python, rmccampbell7
priority: normal
severity: normal
status: open
title: Clarify public name of curses.window
type: enhancement
versions: Python 3.10, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43738>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to