Skip to content

Type default parameters with overloads - #8573

Merged
Jens Hedegaard Nielsen (jenshnielsen) merged 1 commit into
microsoft:mainfrom
jenshnielsen:fix/add-parameter-overloads
Dec 3, 2026
Merged

Jens Hedegaard Nielsen (jenshnielsen) merged 1 commit into
microsoft:mainfrom
jenshnielsen:fix/add-parameter-overloads

Conversation

@jenshnielsen

Copy link
Copy Markdown
Collaborator

Model the default Parameter return separately from explicitly supplied parameter subclasses, eliminating the generic cast while retaining precise instrument typing.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.55%. Comparing base (5ea257f) to head (c03429b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8573   +/-   ##
=======================================
  Coverage   78.54%   78.55%           
=======================================
  Files         311      311           
  Lines       33159    33162    +3     
=======================================
+ Hits        26046    26049    +3     
  Misses       7113     7113           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jenshnielsen
Jens Hedegaard Nielsen (jenshnielsen) force-pushed the fix/add-parameter-overloads branch 3 times, most recently from 765cdbd to 36cb859 Compare December 3, 2026 08:44
Model the default Parameter return of add_parameter separately from an
explicitly supplied parameter subclass, eliminating the generic cast.
The default overload returns Parameter[Any, Any] so that it can be
assigned to more specifically annotated parameters such as
Parameter[float, Self].

Deprecate the now unused TParameter TypeVar using the same module level
__getattr__ pattern used for previously removed TypeVars.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merged via the queue into microsoft:main with commit e4b6800 Dec 3, 2026
19 checks passed
@jenshnielsen
Jens Hedegaard Nielsen (jenshnielsen) deleted the fix/add-parameter-overloads branch December 3, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants