From 0435be34322fe633a91c91b3de2b05a1e38c74c5 Mon Sep 17 00:00:00 2001 From: Shantanu Date: Fri, 21 Feb 2020 21:27:42 -0800 Subject: [PATCH] curses: various fixes (#3771) - fix arg names - fix types based on default value - mark positional-only args --- stdlib/2and3/curses/__init__.pyi | 2 +- stdlib/2and3/curses/panel.pyi | 2 +- stdlib/2and3/curses/textpad.pyi | 6 +++--- tests/stubtest_whitelists/py38.txt | 2 -- tests/stubtest_whitelists/py3_common.txt | 2 -- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/stdlib/2and3/curses/__init__.pyi b/stdlib/2and3/curses/__init__.pyi index 8bd806b47..be7362647 100644 --- a/stdlib/2and3/curses/__init__.pyi +++ b/stdlib/2and3/curses/__init__.pyi @@ -12,4 +12,4 @@ COLS: int COLORS: int COLOR_PAIRS: int -def wrapper(func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ... +def wrapper(__func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ... diff --git a/stdlib/2and3/curses/panel.pyi b/stdlib/2and3/curses/panel.pyi index 90f70c4f7..138e4a9f7 100644 --- a/stdlib/2and3/curses/panel.pyi +++ b/stdlib/2and3/curses/panel.pyi @@ -15,6 +15,6 @@ class _Curses_Panel: # type is (note the s def window(self) -> _CursesWindow: ... def bottom_panel() -> _Curses_Panel: ... -def new_panel(win: _CursesWindow) -> _Curses_Panel: ... +def new_panel(__win: _CursesWindow) -> _Curses_Panel: ... def top_panel() -> _Curses_Panel: ... def update_panels() -> _Curses_Panel: ... diff --git a/stdlib/2and3/curses/textpad.pyi b/stdlib/2and3/curses/textpad.pyi index a218564c0..d2b5766fd 100644 --- a/stdlib/2and3/curses/textpad.pyi +++ b/stdlib/2and3/curses/textpad.pyi @@ -1,11 +1,11 @@ from _curses import _CursesWindow -from typing import Callable, Union +from typing import Callable, Optional, Union def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ... class Textbox: stripspaces: bool - def __init__(self, w: _CursesWindow, insert_mode: bool = ...) -> None: ... - def edit(self, validate: Callable[[int], int]) -> str: ... + def __init__(self, win: _CursesWindow, insert_mode: bool = ...) -> None: ... + def edit(self, validate: Optional[Callable[[int], int]] = ...) -> str: ... def do_command(self, ch: Union[str, int]) -> None: ... def gather(self) -> str: ... diff --git a/tests/stubtest_whitelists/py38.txt b/tests/stubtest_whitelists/py38.txt index 13d1fdb4c..a427bb570 100644 --- a/tests/stubtest_whitelists/py38.txt +++ b/tests/stubtest_whitelists/py38.txt @@ -87,8 +87,6 @@ contextvars.Context.get contextvars.ContextVar.reset contextvars.ContextVar.set copy.PyStringMap -curses.panel.new_panel -curses.wrapper dataclasses.dataclass dataclasses.field dataclasses.make_dataclass diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index cc5b04d74..31cac60ad 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -256,8 +256,6 @@ curses.COLORS curses.COLOR_PAIRS curses.COLS curses.LINES -curses.textpad.Textbox.__init__ -curses.textpad.Textbox.edit dbm.error dbm.ndbm decimal.DecimalException.handle