Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

@ilevkivskyi
Copy link
Member

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 ifmypy_primer looks good, I think it should be OK.

@github-actions
Copy link
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]

@ilevkivskyi
Copy link
MemberAuthor

mypy_primer looks exactly as expected.

@hauntsaninjahauntsaninja merged commita16521f intopython:masterJun 1, 2025
19 checks passed
@ilevkivskyiilevkivskyi deleted the fix-any-union-inference branchJune 1, 2025 01:10
@ilevkivskyiilevkivskyi mentioned this pull requestJun 3, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hauntsaninjahauntsaninjahauntsaninja approved these changes

@JukkaLJukkaLAwaiting requested review from JukkaL

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[1.16 makes more common] Inference of Any against optional type infers Never

2 participants

@ilevkivskyi@hauntsaninja

[8]ページ先頭

©2009-2025 Movatter.jp