pypi / tenacity
tenacity
What changed in tenacity 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.
1 breaking1 deprecations3 new APIs and options22 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inittenacity 927 changes
Breaking changes 1
Only None and 0 are treated as “no wait.”
Deprecations 1
initial is deprecated in favor of multiplier.
New APIs and options 3
AttemptManager supports use as an async context manager.
Retrying accepts a name parameter to produce more meaningful log output.
wait_exponential_jitter adds a min parameter and supports timedelta values.
Fixes and other changes 22
Restores support for combining a callable and a strategy.
The direct-call path now respects enabled=False.
Annotates __radd__ as taking the int seed from sum(), correcting its type signature.
Restores support for falsy wait values.
after_log now guards against seconds_since_start being None.
delay_since_first_attempt is initialized in statistics when begin() runs.
An enabled parameter disables retrying when set to False, including through iterator protocols.
Retrying no longer hangs on cyclic exception __cause__ chains.
Underflow in the exponential wait threshold is avoided.
func.retry.statistics stays synchronized with the copy's statistics.
LoggerProtocol is now compatible with logging.Logger.
Ordinal suffixes are generated correctly for large numbers ending in 11, 12, or 13.
Static typing of @retry-decorated instance methods is fixed.
The .retry, .statistics, and .retry_with attributes are exposed to type checkers.
Plain function composition with retry_base using | and & works again.
retry_if_exception_message accepts an empty message.
Retrying and retry strategies can be pickled for multiprocessing.
Statistics remain visible when a function decorated with @retry is wrapped further.
Tracebacks are formatted inline for loguru compatibility.
When TryAgain wraps a cause, the underlying exception is reraised.
An empty strategy list is rejected with ValueError instead of IndexError.
Fixed annotations for retry() when using an async sleep= function.