Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve type inference when using decorators with pyright #172

Merged
merged 2 commits into from
May 16, 2024

Conversation

breathe
Copy link
Contributor

@breathe breathe commented May 15, 2024

Problem

pyright infers the wrong types for functions which are decorated with @app.command or @app.default.

Use of TypeVar here allows to explicitly preserve the original type information of the original non-wrapped function argument which isn't modified in anyway by the decorators

@codecov-commenter
Copy link

codecov-commenter commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.40%. Comparing base (1f5e3d6) to head (037ddfd).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #172   +/-   ##
=======================================
  Coverage   96.40%   96.40%           
=======================================
  Files          16       16           
  Lines        1864     1865    +1     
  Branches      468      468           
=======================================
+ Hits         1797     1798    +1     
  Misses         29       29           
  Partials       38       38           
Flag Coverage Δ
unittests 96.19% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@BrianPugh BrianPugh merged commit c76368c into BrianPugh:main May 16, 2024
15 checks passed
@BrianPugh
Copy link
Owner

released with v2.6.2, thank you for the contribution!

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.

3 participants