Skip to content

🏷️ ufunc annotations for spacing #363

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

Merged
merged 3 commits into from
Mar 21, 2025
Merged

Conversation

guan404ming
Copy link
Member

Towards #230

@jorenham
Copy link
Member

Nice! There's nothing I can complain about 👌🏻

What I think could make this even better, is by adding an overload for float -> float64, and one for (NDArray[np.float64] | _NestedSequence[float]) -> NDArray[float64].

One reason for this underlying thought is that float64 is (by far) the most commonly used floating type.
But the most important reason, is that if you have some function f(x: float), you're not allowed to pass a floating argument, but it is valid to pass it a float64. See for example numpy/numpy#28076 (comment) for some real-world examples of how this could cause problems for e.g. matplotlib.

@guan404ming
Copy link
Member Author

guan404ming commented Mar 21, 2025

Make sense~

@jorenham jorenham merged commit 4434999 into numpy:main Mar 21, 2025
21 checks passed
@jorenham jorenham added this to the v2.2.x.0 milestone Mar 21, 2025
@jorenham
Copy link
Member

Thanks Guan-Ming 🚀

@guan404ming guan404ming deleted the stub-spacing branch March 22, 2025 11:20
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.

2 participants