I just started to use type annotations and came across a problem using the curses module in Python. More specifically, curses.wrapper(func) expects as argument a function, func, taking a main window, also referred to as "stdscr", as argument. However, I'm unsure on how to annotate such a function. For example
from curses import wrapper
def interactive_shell_curses(stdscr: _curses.window) -> None:
yields the error "Name '_curses' is not defined" even though print(type(stdscr)) prints <class '_curses.window'>. _curses.window is found in the file _curses.pyi from typeshed. However, I'm not sure how to import it or whether I even should. Also, I am not sure whether the best practice here would actually be to just refrain from annotating interactive_shell_curses.
Please advice in how to handle this case!