Skip to content

Commit 1d84cfc

Browse files
committed
chore(retry_until): Type annotation
1 parent e4e440a commit 1d84cfc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libtmux/test.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import tempfile
66
import time
77
import warnings
8-
from typing import Optional
8+
from typing import Callable, Optional
99

1010
from .exc import WaitTimeout
1111

@@ -57,11 +57,11 @@ def retry(seconds: Optional[float] = RETRY_TIMEOUT_SECONDS) -> bool:
5757

5858

5959
def retry_until(
60-
fun,
61-
seconds=RETRY_TIMEOUT_SECONDS,
60+
fun: Callable,
61+
seconds: float = RETRY_TIMEOUT_SECONDS,
6262
*,
63-
interval=RETRY_INTERVAL_SECONDS,
64-
raises=True,
63+
interval: Optional[float] = RETRY_INTERVAL_SECONDS,
64+
raises: Optional[bool] = True,
6565
):
6666
"""
6767
Retry a function until a condition meets or the specified time passes.
@@ -71,7 +71,7 @@ def retry_until(
7171
fun : callable
7272
A function that will be called repeatedly until it returns ``True`` or
7373
the specified time passes.
74-
seconds : int
74+
seconds : float
7575
Seconds to retry. Defaults to ``8``, which is configurable via
7676
``RETRY_TIMEOUT_SECONDS`` environment variables.
7777
interval : float

0 commit comments

Comments
 (0)