mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
Contributed stubs for "retry" package (#4428)
Co-authored-by: Eric Traut <erictr@microsoft.com> Co-authored-by: hauntsaninja <>
This commit is contained in:
1
third_party/2and3/retry/__init__.pyi
vendored
Normal file
1
third_party/2and3/retry/__init__.pyi
vendored
Normal file
@@ -0,0 +1 @@
|
||||
from .api import retry as retry
|
||||
28
third_party/2and3/retry/api.pyi
vendored
Normal file
28
third_party/2and3/retry/api.pyi
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
from logging import Logger
|
||||
from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, TypeVar, Union
|
||||
|
||||
_T = TypeVar("_T", bound=Callable[..., Any])
|
||||
_Decorator = Callable[[_T], _T]
|
||||
_R = TypeVar("_R")
|
||||
|
||||
def retry_call(
|
||||
f: Callable[..., _R],
|
||||
fargs: Optional[Sequence[Any]] = ...,
|
||||
fkwargs: Optional[Dict[str, Any]] = ...,
|
||||
exceptions: Union[Type[Exception], Tuple[Type[Exception], ...]] = ...,
|
||||
tries: int = ...,
|
||||
delay: int = ...,
|
||||
max_delay: Optional[int] = ...,
|
||||
backoff: int = ...,
|
||||
jitter: int = ...,
|
||||
logger: Optional[Logger] = ...,
|
||||
) -> _R: ...
|
||||
def retry(
|
||||
exceptions: Union[Type[Exception], Tuple[Type[Exception], ...]] = ...,
|
||||
tries: int = ...,
|
||||
delay: int = ...,
|
||||
max_delay: Optional[int] = ...,
|
||||
backoff: int = ...,
|
||||
jitter: int = ...,
|
||||
logger: Optional[Logger] = ...,
|
||||
) -> _Decorator: ...
|
||||
Reference in New Issue
Block a user