Repository navigation
Do not narrow types to Never with binder - #18972
Merged
Merged
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: pandas (https://github.com/pandas-dev/pandas)
- pandas/io/formats/style.py:1903: error: "Never" has no attribute "shape" [attr-defined]
- pandas/io/formats/style.py:1906: error: "Never" has no attribute "shape" [attr-defined]
streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/dataframe_util.py: note: In function "convert_anything_to_list":
+ lib/streamlit/dataframe_util.py:927:17: error: List item 0 has incompatible type "Union[str, int, float]"; expected "V_co" [list-item]
static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/frame.py:5610: error: Unused "type: ignore" comment [unused-ignore]
spark (https://github.com/apache/spark)
+ python/pyspark/core/context.py:837: error: Unused "type: ignore" comment [unused-ignore]
+ python/pyspark/core/context.py:838: error: Unused "type: ignore" comment [unused-ignore]
+ python/pyspark/ml/connect/readwrite.py:98: error: Redundant cast to "JavaEstimator[Any]" [redundant-cast]
+ python/pyspark/ml/connect/readwrite.py:101: error: Redundant cast to "JavaEvaluator" [redundant-cast]
Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/parsing.py:588: error: "Never" has no attribute "__iter__" (not iterable) [attr-defined]
- tanjun/dependencies/limiters.py:851: error: "Never" has no attribute "unlock" [attr-defined]
|
Collaborator
|
This impacts several existing issues: sterliakov/mypy-issues#27 |
Member
Author
|
Hm, interesting... As I said, it is gray area, but IMO most of the impact looks positive, I will however take a closer look later today or tomorrow. |
Member
Author
|
OK, I went through @JukkaL unless you have objections, I am going to merge this soon. |
This was referenced May 28, 2025
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
Sign up for free
to 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 #18967
Fixes #16494
Fixes #15793
Fixes #12949
As you can see from updated test cases, it is kind of gray area, so whether we go this way will depend on the
mypy_primerresults (and also potentially on Dropbox internal code bases, where the above issue may cause problems).