Repository navigation
Conversation
AryanRG
marked this pull request as ready for review
October 16, 2026 23:47
AryanRG
marked this pull request as draft
October 16, 2026 23:49
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.
Passing a callable positionally to
captureoracapturecurrently prevents forwarding a target keyword namedsync_fnorasync_fn: Python raises a duplicate-bindingTypeErrorbefore the target runs. This change lets the positional callable receive every keyword, while retaining the legacy callable-by-keyword form when there are no positional arguments.The dispatcher selects the positional callable first; otherwise it consumes the original callable keyword. Paired ParamSpec overloads preserve static argument checking and result/NoReturn inference. Regression tests cover both conventions, return and exception identity, async suspension, and traceback removal. The tutorial explains the dispatch rule. The release note is
newsfragments/50.bugfix.rst, added in a separate follow-up commit after obtaining this PR number.Compatibility is scoped to previously valid calls, not identical behavior for every observation:
inspect.signatureand runtime annotations now expose(*args: Any, **kwargs: Any) -> Value[Any] | Errorinstead of a named required callable and ParamSpec. Reflective binding, autospec, and injection consumers may behave differently; no downstream reflective integration was tested. Static overloads retain precise typing.acapture()call now returns a coroutine and raises the missing-callableTypeErrorwhen awaited, instead of raising during coroutine construction. That error includes anacaptureframe, and malformed-call diagnostic precedence can differ.acaptureremains an async function, and valid target execution remains deferred until await.sync_fn/async_fnselects the legacy callable and cannot also be forwarded under that name; use a positional callable for the collision case. Positional-callable-plus-colliding-keyword forms were previously invalid and now gain the forwarding meaning.Local validation on macOS arm64, against base
03ed6218b08001877745bb1a9e180c8c5cf7c903:git diff --checkpassed. Installed package bytes match source for the completeness check.AI assistance was used to prepare implementation and regression tests. Hosted CI results are separate from this local evidence. Linux, Windows, PyPy, other Python versions, reflective integrations, and performance benchmarks were not run locally.