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

Use Never in more messages, use ambiguous in join #17304

Merged
merged 2 commits into from
May 31, 2024

Conversation

hauntsaninja
Copy link
Collaborator

Switches the logic from #16994 to use ambiguous (since is_noreturn was only meant for error messages)

See also #15996

Switches the logic from python#16994
to use ambiguous (since is_noreturn was only meant for error messages)

See also python#15996
@hauntsaninja hauntsaninja requested a review from cdce8p May 31, 2024 07:15
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

steam.py (https://github.com/Gobot1234/steam.py)
- steam/types/vdf.py:31: error: Incompatible return value type (implicitly returns "None", expected "NoReturn")  [empty-body]
+ steam/types/vdf.py:31: error: Incompatible return value type (implicitly returns "None", expected "Never")  [empty-body]
- steam/types/vdf.py:33: error: Incompatible return value type (implicitly returns "None", expected "NoReturn")  [empty-body]
+ steam/types/vdf.py:33: error: Incompatible return value type (implicitly returns "None", expected "Never")  [empty-body]
- steam/ext/commands/commands.py:245: error: Value of type "Callable[[VarArg(Any), KwArg(Any)], NoReturn]" is not indexable  [index]
+ steam/ext/commands/commands.py:245: error: Value of type "Callable[[VarArg(Any), KwArg(Any)], Never]" is not indexable  [index]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/parsing.py:599: error: Never has no attribute "__iter__" (not iterable)  [attr-defined]
+ tanjun/parsing.py:599: error: "Never" has no attribute "__iter__" (not iterable)  [attr-defined]
- tanjun/dependencies/limiters.py:857: error: Never has no attribute "unlock"  [attr-defined]
+ tanjun/dependencies/limiters.py:857: error: "Never" has no attribute "unlock"  [attr-defined]
- tanjun/clients.py:2291: error: Never has no attribute "__iter__" (not iterable)  [attr-defined]
+ tanjun/clients.py:2291: error: "Never" has no attribute "__iter__" (not iterable)  [attr-defined]

sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/i18n.py:443:17: error: Never has no attribute "apply_translated_message"  [attr-defined]
+ sphinx/transforms/i18n.py:443:17: error: "Never" has no attribute "apply_translated_message"  [attr-defined]

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/runtime/fragment_test.py:161:20: error: Non-overlapping equality check (left operand type: "Callable[..., NoReturn]", right operand type: "Literal[7]")  [comparison-overlap]
+ lib/tests/streamlit/runtime/fragment_test.py:161:20: error: Non-overlapping equality check (left operand type: "Callable[..., Never]", right operand type: "Literal[7]")  [comparison-overlap]
- lib/tests/streamlit/runtime/fragment_test.py:165:13: error: Unsupported operand types for + ("Callable[..., NoReturn]" and "int")  [operator]
+ lib/tests/streamlit/runtime/fragment_test.py:165:13: error: Unsupported operand types for + ("Callable[..., Never]" and "int")  [operator]
- lib/tests/streamlit/runtime/fragment_test.py:205:13: error: Unsupported operand types for + ("Callable[..., NoReturn]" and "int")  [operator]
+ lib/tests/streamlit/runtime/fragment_test.py:205:13: error: Unsupported operand types for + ("Callable[..., Never]" and "int")  [operator]

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/sql/datatypes.py:795: note:          def _from_sqlglot_MAP(cls) -> NoReturn
+ ibis/backends/sql/datatypes.py:795: note:          def _from_sqlglot_MAP(cls) -> Never

Copy link
Collaborator

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @hauntsaninja 👍🏻

@hauntsaninja hauntsaninja merged commit c3bbd1c into python:master May 31, 2024
18 checks passed
@hauntsaninja hauntsaninja deleted the mypy-never branch May 31, 2024 18:29
GiorgosPapoutsakis pushed a commit to GiorgosPapoutsakis/mypy that referenced this pull request Jun 3, 2024
Switches the logic from python#16994 to use
ambiguous (since is_noreturn was only meant for error messages)

See also python#15996
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