Skip to content

Commit

Permalink
type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Dec 19, 2023
1 parent 1a52035 commit 305cc7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cantok/tokens/abstract_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def keep_on(self) -> bool:
def is_cancelled(self, direct: bool = True) -> bool:
return self.get_report(direct=direct).cause != CancelCause.NOT_CANCELLED

def wait(self, step: Union[int, float] = 0.0001, timeout: Optional[Union[int, float]] = None, is_async: bool = False) -> Awaitable[None]:
def wait(self, step: Union[int, float] = 0.0001, timeout: Optional[Union[int, float]] = None, is_async: bool = False) -> Awaitable:
if step < 0:
raise ValueError('The token polling iteration time cannot be less than zero.')
if timeout is not None and timeout < 0:
Expand All @@ -115,7 +115,7 @@ def wait(self, step: Union[int, float] = 0.0001, timeout: Optional[Union[int, fl

token = self + local_token

async def async_wait() -> Awaitable[None]:
async def async_wait() -> Awaitable:
while token:
await async_sleep(step)

Expand Down

0 comments on commit 305cc7e

Please sign in to comment.