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

refactor: try conditionally applying no type check #773

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ss2165
Copy link
Member

@ss2165 ss2165 commented Jan 17, 2025

Addressing #277
Following a suggestion from python/cpython#106309

It seems to partly work, not sure what's limiting it. The red squiggles on most lines are gone, but not inside "angle" or on the type annotations

image

Following a suggestion from python/cpython#106309

It seems to _partly_ work, not sure what's limiting it.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.02%. Comparing base (92ec6d1) to head (c276785).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #773   +/-   ##
=======================================
  Coverage   93.02%   93.02%           
=======================================
  Files          71       71           
  Lines        8327     8327           
=======================================
  Hits         7746     7746           
  Misses        581      581           

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

@acl-cqc
Copy link
Contributor

acl-cqc commented Jan 29, 2025

I'm never quite sure how much type-checkers actually run the code, but can you do:

if TYPE_CHECKING:
  guppy = cast(_Guppy, no_type_check)
else:
  ....

I guess guppy = no_type_check raises problems at calls to the guppy-decorated functions

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