Repository navigation
Conversation
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This branch has not been deployed
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.
Calling a retried method through its class with
selfsupplied by keyword fails before the target runs:Before this change, this raises
TypeError: Retrying.__call__() got multiple values for argument 'self'; afterwards it prints42. The same receiver collision affectsAsyncRetryingandTornadoRetrying, including direct controller calls andwraps().Make only the controller receiver positional-only in the abstract interface and three built-in implementations. The target's
selfkeyword then reaches**kwargs, while direct target selection usingcontroller(fn=target, ...)remains supported. Retry decisions and execution bodies are unchanged. Regression tests cover direct positional/keyword targets,wraps, andretry, including actual retries and callback kwargs; synchronous and asyncio cases also cover disabled retries. A Reno fixes entry is included and was verified in the generated changelog and rendered HTML.There is a compatibility tradeoff: the rare explicit unbound call
Retrying.__call__(self=controller, fn=target)must becomeRetrying.__call__(controller, fn=target). The analogous asyncio and Tornado calls have the same change, and class-level signature inspection now reports the receiver as positional-only. Normal bound controller calls retain their signatures. Third-party subclasses overriding__call__need their own fix; a target keyword namedfnremains outside this change. Tornado's existing directenabled=Falseissue is also outside scope (#716).Validation on macOS with CPython 3.12.15, against base
32ac68f0941319c0d2f4fb927f96e4ee29bb46c6:pytest -q tests/test_tenacity.py tests/test_asyncio.py tests/test_tornado.py -k self_keyword_is_forwarded): 17 passed, 178 deselected, four subtests passed.poe all: 202 tests passed; Ruff lint and format checks passed; strict mypy passed for 19 source files; 35 doctests passed; both warning-as-error Sphinx builds passed.reno lint,uv build, anduvx twine check --strict dist/*passed.The local runtime checks cover Python 3.12 only; the supported interpreter/OS matrix and installed-wheel behavior were not verified locally. Local results do not establish hosted CI success or maintainer acceptance.
AI tools assisted with preparing the implementation, tests, and this description. A separate automated review reproduced the before/after failure, reran the local aggregate checks, and assessed the compatibility tradeoff.