fix: expose .retry, .statistics, .retry_with to type checkers#601
Merged
mergify[bot] merged 1 commit intomainfrom Feb 23, 2026
Conversation
Add _RetryDecorated Protocol that combines the original callable signature (via ParamSpec) with the retry control attributes. Update all retry() overloads, _AsyncRetryDecorator, and wraps() methods to return _RetryDecorated[P, R] instead of bare WrappedFn. This lets mypy see .retry, .statistics, and .retry_with on decorated functions without # type: ignore, fixing a long-standing typing gap. Removes ~30 now-unnecessary type: ignore comments from tests. Closes #346 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Change-Id: I8c2bc7b49a0cb51175a8e0bf33d9742f10bc49a0
137d9a2 to
c25b946
Compare
Contributor
Merge Queue StatusRule:
This pull request spent 8 seconds in the queue, with no time running CI. Required conditions to merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add _RetryDecorated Protocol that combines the original callable
signature (via ParamSpec) with the retry control attributes. Update
all retry() overloads, _AsyncRetryDecorator, and wraps() methods to
return _RetryDecorated[P, R] instead of bare WrappedFn.
This lets mypy see .retry, .statistics, and .retry_with on decorated
functions without # type: ignore, fixing a long-standing typing gap.
Removes ~30 now-unnecessary type: ignore comments from tests.
Closes #346
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com