Contributed stubs for "retry" package (#4428)

Co-authored-by: Eric Traut <erictr@microsoft.com>
Co-authored-by: hauntsaninja <>
This commit is contained in:
Eric Traut
2020-08-15 18:29:15 -07:00
committed by GitHub
parent 002a444dff
commit e2d335b6ef
2 changed files with 29 additions and 0 deletions

1
third_party/2and3/retry/__init__.pyi vendored Normal file
View File

@@ -0,0 +1 @@
from .api import retry as retry

28
third_party/2and3/retry/api.pyi vendored Normal file
View 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: ...