Add default values for third-party stubs beginning with 'P' (#9957)

This commit is contained in:
Alex Waygood
2023-03-27 18:58:53 +01:00
committed by GitHub
parent 20f9b3685d
commit 6fd7e36e80
248 changed files with 2181 additions and 2133 deletions

View File

@@ -30,7 +30,7 @@ class AbstractListener(threading.Thread):
_ready: bool # undocumented
_queue: Queue[sys._OptExcInfo | None] # undocumented
daemon: bool
def __init__(self, suppress: bool = ..., **kwargs: Callable[..., bool | None] | None) -> None: ...
def __init__(self, suppress: bool = False, **kwargs: Callable[..., bool | None] | None) -> None: ...
@property
def suppress(self) -> bool: ...
@property
@@ -65,7 +65,7 @@ class Events(Generic[_T, _AbstractListener_T]):
) -> None: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _T: ...
def get(self, timeout: float | None = ...) -> _T | None: ...
def get(self, timeout: float | None = None) -> _T | None: ...
def _event_mapper(self, event: Callable[_P, object]) -> Callable[_P, None]: ...
class NotifierMixin: ...

View File

@@ -17,7 +17,7 @@ class Events(_util.Events[Any, Listener]):
def __init__(self) -> None: ...
def __next__(self) -> Press | Release: ...
def get(self, timeout: float | None = ...) -> Press | Release | None: ...
def get(self, timeout: float | None = None) -> Press | Release | None: ...
class HotKey:
def __init__(self, keys: list[KeyCode], on_activate: Callable[[], object]) -> None: ...

View File

@@ -13,7 +13,7 @@ class KeyCode:
char: str | None
is_dead: bool | None
combining: str | None
def __init__(self, vk: str | None = ..., char: str | None = ..., is_dead: bool = ..., **kwargs: str) -> None: ...
def __init__(self, vk: str | None = None, char: str | None = None, is_dead: bool = False, **kwargs: str) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
def join(self, key: Self) -> Self: ...
@@ -124,9 +124,9 @@ class Controller:
class Listener(AbstractListener):
def __init__(
self,
on_press: Callable[[Key | KeyCode | None], None] | None = ...,
on_release: Callable[[Key | KeyCode | None], None] | None = ...,
suppress: bool = ...,
on_press: Callable[[Key | KeyCode | None], None] | None = None,
on_release: Callable[[Key | KeyCode | None], None] | None = None,
suppress: bool = False,
**kwargs: Any,
) -> None: ...
def canonical(self, key: Key | KeyCode) -> Key | KeyCode: ...

View File

@@ -26,4 +26,4 @@ class Events(_util.Events[Any, Listener]):
def __init__(self) -> None: ...
def __next__(self) -> Move | Click | Scroll: ...
def get(self, timeout: float | None = ...) -> Move | Click | Scroll | None: ...
def get(self, timeout: float | None = None) -> Move | Click | Scroll | None: ...

View File

@@ -54,7 +54,7 @@ class Controller:
def press(self, button: Button) -> None: ...
def release(self, button: Button) -> None: ...
def move(self, dx: int, dy: int) -> None: ...
def click(self, button: Button, count: int = ...) -> None: ...
def click(self, button: Button, count: int = 1) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
@@ -86,9 +86,9 @@ class Listener(AbstractListener):
def __init__(
self,
on_move: Callable[[int, int], bool | None] | None = ...,
on_click: Callable[[int, int, Button, bool], bool | None] | None = ...,
on_scroll: Callable[[int, int, int, int], bool | None] | None = ...,
suppress: bool = ...,
on_move: Callable[[int, int], bool | None] | None = None,
on_click: Callable[[int, int, Button, bool], bool | None] | None = None,
on_scroll: Callable[[int, int, int, int], bool | None] | None = None,
suppress: bool = False,
**kwargs: Any,
) -> None: ...