Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tenacity/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def get_callback_name(cb: typing.Callable[..., typing.Any]) -> str:
return ".".join(segments)


time_unit_type = int | float | timedelta
time_unit_type: typing.TypeAlias = int | float | timedelta # noqa: PYI042


def to_seconds(time_unit: time_unit_type) -> float:
Expand Down
2 changes: 1 addition & 1 deletion tenacity/asyncio/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __ror__( # type: ignore[misc,override]
return retry_any(other, self)


RetryBaseT = (
RetryBaseT: typing.TypeAlias = (
async_retry_base | typing.Callable[["RetryCallState"], typing.Awaitable[bool]]
)

Expand Down
2 changes: 1 addition & 1 deletion tenacity/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __ror__(self, other: "RetryBaseT") -> "retry_any":
return retry_any(other, self)


RetryBaseT = retry_base | typing.Callable[["RetryCallState"], bool]
RetryBaseT: typing.TypeAlias = retry_base | typing.Callable[["RetryCallState"], bool]


class _retry_never(retry_base):
Expand Down
2 changes: 1 addition & 1 deletion tenacity/stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __or__(self, other: "stop_base") -> "stop_any":
return stop_any(self, other)


StopBaseT = stop_base | typing.Callable[["RetryCallState"], bool]
StopBaseT: typing.TypeAlias = stop_base | typing.Callable[["RetryCallState"], bool]


class stop_any(stop_base):
Expand Down
4 changes: 3 additions & 1 deletion tenacity/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def __radd__(self, other: "WaitBaseT | int") -> "wait_combine | wait_base":
return wait_combine(self, other)


WaitBaseT = wait_base | typing.Callable[["RetryCallState"], float | int]
WaitBaseT: typing.TypeAlias = (
wait_base | typing.Callable[["RetryCallState"], float | int]
)


class wait_fixed(wait_base):
Expand Down