Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.tenacity Namespace Reference

Namespaces

namespace  _asyncio
 
namespace  _utils
 
namespace  after
 
namespace  before
 
namespace  before_sleep
 
namespace  nap
 
namespace  retry
 
namespace  stop
 
namespace  tornadoweb
 
namespace  wait
 

Data Structures

class  AttemptManager
 
class  BaseAction
 
class  BaseRetrying
 
class  DoAttempt
 
class  DoSleep
 
class  Future
 
class  RetryAction
 
class  RetryCallState
 
class  RetryError
 
class  Retrying
 
class  TryAgain
 

Functions

t.Any _first_set (t.Union[t.Any, object] first, t.Any second)
 
WrappedFn retry (WrappedFn func)
 
t.Callable[[WrappedFn], WrappedFnretry (t.Callable[[t.Union[int, float]], None] sleep=sleep, "StopBaseT" stop=stop_never, "WaitBaseT" wait=wait_none(), "RetryBaseT" retry=retry_if_exception_type(), t.Callable[["RetryCallState"], None] before=before_nothing, t.Callable[["RetryCallState"], None] after=after_nothing, t.Optional[t.Callable[["RetryCallState"], None]] before_sleep=None, bool reraise=False, t.Type["RetryError"] retry_error_cls=RetryError, t.Optional[t.Callable[["RetryCallState"], t.Any]] retry_error_callback=None)
 
t.Any retry (*t.Any dargs, **t.Any dkw)
 

Variables

 tornado = None
 
 WrappedFnReturnT = t.TypeVar("WrappedFnReturnT")
 
 WrappedFn = t.TypeVar("WrappedFn", bound=t.Callable[..., t.Any])
 
 NO_RESULT = object()
 
 _unset = object()
 
 FutureGenericT = futures.Future[t.Any]
 

Function Documentation

◆ _first_set()

t.Any _first_set ( t.Union[t.Any, object]  first,
t.Any  second 
)
protected

Definition at line 147 of file __init__.py.

147def _first_set(first: t.Union[t.Any, object], second: t.Any) -> t.Any:
148 return second if first is _unset else first
149
150
for i

References i.

Referenced by BaseRetrying.copy().

Here is the caller graph for this function:

◆ retry() [1/3]

t.Any retry ( *t.Any  dargs,
**t.Any  dkw 
)
Wrap a function with a new `Retrying` object.

:param dargs: positional arguments passed to Retrying object
:param dkw: keyword arguments passed to the Retrying object

Definition at line 518 of file __init__.py.

518def retry(*dargs: t.Any, **dkw: t.Any) -> t.Any:
519 """Wrap a function with a new `Retrying` object.
520
521 :param dargs: positional arguments passed to Retrying object
522 :param dkw: keyword arguments passed to the Retrying object
523 """
524 # support both @retry and @retry() as valid syntax
525 if len(dargs) == 1 and callable(dargs[0]):
526 return retry()(dargs[0])
527 else:
528
529 def wrap(f: WrappedFn) -> WrappedFn:
530 if isinstance(f, retry_base):
532 f"Got retry_base instance ({f.__class__.__name__}) as callable argument, "
533 f"this will probably hang indefinitely (did you mean retry={f.__class__.__name__}(...)?)"
534 )
535 r: "BaseRetrying"
536 if iscoroutinefunction(f):
537 r = AsyncRetrying(*dargs, **dkw)
538 elif tornado and hasattr(tornado.gen, "is_coroutine_function") and tornado.gen.is_coroutine_function(f):
539 r = TornadoRetrying(*dargs, **dkw)
540 else:
541 r = Retrying(*dargs, **dkw)
542
543 return r.wraps(f)
544
545 return wrap
546
547

References i.

◆ retry() [2/3]

t.Callable[[WrappedFn], WrappedFn] retry ( t.Callable[[t.Union[int, float]], None]   sleep = sleep,
"StopBaseT"   stop = stop_never,
"WaitBaseT"   wait = wait_none(),
"RetryBaseT"   retry = retry_if_exception_type(),
t.Callable[["RetryCallState"], None]   before = before_nothing,
t.Callable[["RetryCallState"], None]   after = after_nothing,
t.Optional[t.Callable[["RetryCallState"], None]]   before_sleep = None,
bool   reraise = False,
t.Type["RetryError"]   retry_error_cls = RetryError,
t.Optional[t.Callable[["RetryCallState"], t.Any]]   retry_error_callback = None 
)

Definition at line 503 of file __init__.py.

514) -> t.Callable[[WrappedFn], WrappedFn]:
515 ...
516
517

References i.

◆ retry() [3/3]

WrappedFn retry ( WrappedFn  func)

Definition at line 498 of file __init__.py.

498def retry(func: WrappedFn) -> WrappedFn:
499 ...
500
501
502@t.overload

Variable Documentation

◆ _unset

_unset = object()
protected

Definition at line 144 of file __init__.py.

◆ FutureGenericT

FutureGenericT = futures.Future[t.Any]

Definition at line 397 of file __init__.py.

◆ NO_RESULT

NO_RESULT = object()

Definition at line 105 of file __init__.py.

◆ tornado

tornado = None

Definition at line 87 of file __init__.py.

◆ WrappedFn

WrappedFn = t.TypeVar("WrappedFn", bound=t.Callable[..., t.Any])

Definition at line 98 of file __init__.py.

◆ WrappedFnReturnT

WrappedFnReturnT = t.TypeVar("WrappedFnReturnT")

Definition at line 97 of file __init__.py.