TYP: fix ``NDArray[floating] + float`` return type by jorenham · Pull Request #28807 · numpy/numpy · GitHub
Skip to content

TYP: fix NDArray[floating] + float return type#28807

Merged
charris merged 1 commit into
numpy:mainfrom
jorenham:typing/fix-28805
Apr 24, 2025
Merged

TYP: fix NDArray[floating] + float return type#28807
charris merged 1 commit into
numpy:mainfrom
jorenham:typing/fix-28805

Conversation

@jorenham

Copy link
Copy Markdown
Member

Closes #28805

@jorenham

Copy link
Copy Markdown
Member Author

@github-actions

Copy link
Copy Markdown

Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code:

vision (https://github.com/pytorch/vision)
- torchvision/utils.py:270: error: Unused "type: ignore" comment  [unused-ignore]

@jorenham

Copy link
Copy Markdown
Member Author

the mypy_primer diff for torchvision is irrelevant

@charris

charris commented Apr 24, 2025

Copy link
Copy Markdown
Member

or are there no 2.2.6 plans

2.2.6 plans are ... undecided. Go ahead and mark it.

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Apr 24, 2025
@charris charris merged commit 5570e92 into numpy:main Apr 24, 2025
@charris

charris commented Apr 24, 2025

Copy link
Copy Markdown
Member

Thanks Joren.

@jorenham jorenham deleted the typing/fix-28805 branch April 24, 2025 21:14
@jorenham

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TYP: mypy infers that adding/multiplying a npt.NDArray[np.float32] with a float promotes dtype to Any or np.float64

2 participants