pypi / tenacity
tenacity
What changed in tenacity 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
3 breaking1 deprecations4 new APIs and options2 behavior and defaults25 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inittenacity 935 changes
Breaking changes 3
Only None and 0 are treated as “no wait.”
Drops support for Python 3.9.
The statistics attribute has an API breakage in this major release.
Deprecations 1
initial is deprecated in favor of multiplier.
New APIs and options 4
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.
Adds the wait_exception strategy.
Behavior and default changes 2
Supports async sleep for a sync function being retried.
Typing now accepts a non-standard logger in helpers that log something.
Fixes and other changes 25
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.
Formats the number of seconds in before_sleep_log output.
Adds support for Python 3.14.
The min argument is now respected by wait_random_exponential.