TYP: Fix overlapping overloads issue in "2 in, 1 out" ufuncs#28168
Merged
charris merged 1 commit intonumpy:mainfrom Jan 16, 2025
Merged
TYP: Fix overlapping overloads issue in "2 in, 1 out" ufuncs#28168charris merged 1 commit intonumpy:mainfrom
charris merged 1 commit intonumpy:mainfrom
Conversation
Member
Author
|
It's a bug that has gone by unnoticed for 4 years, so I'm not sure whether this should be a backport candidate or not. What do you think @charris? |
|
Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code: pandas (https://github.com/pandas-dev/pandas)
- pandas/core/frame.py:11608: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[Any]]") [assignment]
|
Member
Author
|
@hauntsaninja maybe it's old news, but mypy primer seems to work 🎉 |
Member
We will be supporting 2.2.x for another 5-6 months and I would like to make the typing as good as we can. I think there is minimal risk in doing so. |
Member
|
Thanks Joren. |
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.
Closes #28162
before:
after:
The same fix has also been applied to
.outer