Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Infer constraints eagerly if actual is Any#19190
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
Contributor
Diff frommypy_primer, showing the effect of this PR on open source code: typeshed-stats (https://github.com/AlexWaygood/typeshed-stats): 1.30x slower (72.8s -> 94.5s in single noisy sample)nox (https://github.com/wntrblm/nox): 1.32x slower (24.9s -> 32.7s in single noisy sample)psycopg (https://github.com/psycopg/psycopg)+ tests/types/test_range.py:131: error: Unused "type: ignore" comment [unused-ignore]+ tests/types/test_range.py:179: error: Unused "type: ignore" comment [unused-ignore]zulip (https://github.com/zulip/zulip)- zerver/lib/soft_deactivation.py:74: error: Need type annotation for "event_last_message_id" [var-annotated]- zerver/actions/invites.py:446: error: Need type annotation for "realm_id" [var-annotated]- zerver/actions/invites.py:449: error: Need type annotation for "referrer" [var-annotated]- zerver/views/video_calls.py:374: error: "Never" has no attribute "text" [attr-defined]- zerver/views/video_calls.py:377: error: "Never" has no attribute "text" [attr-defined]- zerver/views/video_calls.py:397: error: "Never" has no attribute "text" [attr-defined]- zerver/webhooks/pivotal/view.py:33: error: "Never" has no attribute "text" [attr-defined]- zerver/webhooks/pivotal/view.py:34: error: "Never" has no attribute "text" [attr-defined]- zerver/webhooks/pivotal/view.py:36: error: "Never" has no attribute "text" [attr-defined]- zerver/tests/test_middleware.py:73: error: "Never" has no attribute "get" [attr-defined]- zerver/tests/test_middleware.py:78: error: "Never" has no attribute "get" [attr-defined]- zerver/tests/test_middleware.py:205: error: "Never" has no attribute "get" [attr-defined]- zerver/tests/test_middleware.py:222: error: "Never" has no attribute "get" [attr-defined]- zerver/tests/test_middleware.py:232: error: "Never" has no attribute "get" [attr-defined]- zerver/tests/test_bots.py:622: error: Need type annotation for "new_bot" [var-annotated]- zerver/tests/test_bots.py:2039: error: Need type annotation for "new_bot" [var-annotated]- zerver/tests/test_audit_log.py:174: error: "Never" has no attribute "name" [attr-defined]xarray (https://github.com/pydata/xarray)- xarray/computation/apply_ufunc.py: note: In function "apply_variable_ufunc":- xarray/computation/apply_ufunc.py:838: error: "Never" has no attribute "ndim" [attr-defined]- xarray/computation/apply_ufunc.py:841: error: "Never" has no attribute "ndim" [attr-defined]cki-lib (https://gitlab.com/cki-project/cki-lib)- cki_lib/config_tree.py:30: error: Need type annotation for "extend" [var-annotated]- cki_lib/yaml.py:93: error: Need type annotation for "include" [var-annotated]- cki_lib/messagequeue.py:225: error: Need type annotation for "routing_key" [var-annotated]- cki_lib/cki_pipeline.py:443: error: Need type annotation for "values" (hint: "values: list[<type>] = ...") [var-annotated] |
MemberAuthor
ilevkivskyi commentedJun 1, 2025
|
hauntsaninja approved these changesJun 1, 2025
a16521f intopython:master 19 checks passed
Uh oh!
There was an error while loading.Please reload this page.
Closed
Sign up for freeto 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.
Fixes#8829
This case is more common in 1.16 due to some changes in binder, so it would be good to fix it. My fix may be a bit naive, but if
mypy_primerlooks good, I think it should be OK.