From 6bbcae589719527cf207e695e133c9692cf4ca8d Mon Sep 17 00:00:00 2001 From: Spencer Phillip Young Date: Thu, 9 May 2024 20:36:49 -0700 Subject: [PATCH] fix typehint for keywait --- ahk/_async/engine.py | 10 +++++----- ahk/_sync/engine.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ahk/_async/engine.py b/ahk/_async/engine.py index a013941..1a24e46 100644 --- a/ahk/_async/engine.py +++ b/ahk/_async/engine.py @@ -1083,19 +1083,19 @@ async def key_up(self, key: Union[str, Key], blocking: bool = True) -> Union[Non # fmt: off @overload - async def key_wait(self, key_name: str, *, timeout: Optional[int] = None, logical_state: bool = False, released: bool = False) -> bool: ... + async def key_wait(self, key_name: str, *, timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False) -> bool: ... @overload - async def key_wait(self, key_name: str, *, blocking: Literal[True], timeout: Optional[int] = None, logical_state: bool = False, released: bool = False) -> bool: ... + async def key_wait(self, key_name: str, *, blocking: Literal[True], timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False) -> bool: ... @overload - async def key_wait(self, key_name: str, *, blocking: Literal[False], timeout: Optional[int] = None, logical_state: bool = False, released: bool = False) -> AsyncFutureResult[bool]: ... + async def key_wait(self, key_name: str, *, blocking: Literal[False], timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False) -> AsyncFutureResult[bool]: ... @overload - async def key_wait(self, key_name: str, *, timeout: Optional[int] = None, logical_state: bool = False, released: bool = False, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]: ... + async def key_wait(self, key_name: str, *, timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]: ... # fmt: on async def key_wait( self, key_name: str, *, - timeout: Optional[int] = None, + timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False, blocking: bool = True, diff --git a/ahk/_sync/engine.py b/ahk/_sync/engine.py index 4cb7913..b10614e 100644 --- a/ahk/_sync/engine.py +++ b/ahk/_sync/engine.py @@ -1071,19 +1071,19 @@ def key_up(self, key: Union[str, Key], blocking: bool = True) -> Union[None, Fut # fmt: off @overload - def key_wait(self, key_name: str, *, timeout: Optional[int] = None, logical_state: bool = False, released: bool = False) -> bool: ... + def key_wait(self, key_name: str, *, timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False) -> bool: ... @overload - def key_wait(self, key_name: str, *, blocking: Literal[True], timeout: Optional[int] = None, logical_state: bool = False, released: bool = False) -> bool: ... + def key_wait(self, key_name: str, *, blocking: Literal[True], timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False) -> bool: ... @overload - def key_wait(self, key_name: str, *, blocking: Literal[False], timeout: Optional[int] = None, logical_state: bool = False, released: bool = False) -> FutureResult[bool]: ... + def key_wait(self, key_name: str, *, blocking: Literal[False], timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False) -> FutureResult[bool]: ... @overload - def key_wait(self, key_name: str, *, timeout: Optional[int] = None, logical_state: bool = False, released: bool = False, blocking: bool = True) -> Union[bool, FutureResult[bool]]: ... + def key_wait(self, key_name: str, *, timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False, blocking: bool = True) -> Union[bool, FutureResult[bool]]: ... # fmt: on def key_wait( self, key_name: str, *, - timeout: Optional[int] = None, + timeout: Optional[int | float] = None, logical_state: bool = False, released: bool = False, blocking: bool = True,