Repository navigation
Type default parameters with overloads - #8573
Open
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 2 commits into
Open
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 2 commits into
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 2 commits into
Conversation
Jens Hedegaard Nielsen (jenshnielsen)
requested a review
from a team
as a code owner
October 8, 2026 06:43
Model the default Parameter return separately from explicitly supplied parameter subclasses, eliminating the generic cast while retaining precise instrument typing. Co-authored-by: Copilot <[email protected]>
Jens Hedegaard Nielsen (jenshnielsen)
force-pushed
the
fix/add-parameter-overloads
branch
from
October 8, 2026 06:47
96a19f8 to
418bb60
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8573 +/- ##
==========================================
- Coverage 72.37% 72.37% -0.01%
==========================================
Files 307 307
Lines 32397 32396 -1
==========================================
- Hits 23447 23446 -1
Misses 8950 8950 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Mypy infers an unannotated constructor receiver as the enclosing class when resolving add_parameter's Self return type. Explicit self: Self annotations are required to assign the result to Parameter[..., Self] without losing subclass precision for parameter.instrument. This works around the implicit Self inference limitation tracked in: python/mypy#14075 Add a regression test covering constructor inference and inherited parameter instrument types. Keep the overload and existing covariance unchanged. Co-authored-by: Copilot <[email protected]>
Jens Hedegaard Nielsen (jenshnielsen)
force-pushed
the
fix/add-parameter-overloads
branch
from
October 8, 2026 09:31
991217f to
43c1926
Compare
|
|
||
| log = logging.getLogger(__name__) | ||
|
|
||
| # Cannot convert to PEP 695: uses default= which requires PEP 696 (Python 3.13+). |
Collaborator
Author
There was a problem hiding this comment.
comment should not be removed
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.
Model the default Parameter return separately from explicitly supplied parameter subclasses, eliminating the generic cast while retaining precise instrument typing.