Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TYP: add missing "b1" literals for dtype[bool] #28674

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 1 commit into from
Apr 9, 2025

Conversation

jorenham
Copy link
Member

@jorenham jorenham commented Apr 9, 2025

This fixes np.dtype("b1") from not being recognized by static-type-checkers as dtype[bool].

@jorenham jorenham added 09 - Backport-Candidate PRs tagged should be backported 41 - Static typing labels Apr 9, 2025
@@ -111,7 +113,7 @@ assert_type(dtype_U.base, np.dtype[Any])
assert_type(dtype_U.subdtype, None | tuple[np.dtype[Any], tuple[int, ...]])
assert_type(dtype_U.newbyteorder(), np.dtype[np.str_])
assert_type(dtype_U.type, type[np.str_])
assert_type(dtype_U.name, str)
assert_type(dtype_U.name, LiteralString)
Copy link
Member Author

Choose a reason for hiding this comment

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

Mypy accepted this for some reason, but pyright reported this as an error.

@charris charris merged commit 4223c88 into numpy:main Apr 9, 2025
75 checks passed
@charris
Copy link
Member

charris commented Apr 9, 2025

Thanks Joren.

@jorenham jorenham deleted the typing/add-missing-bool-dtype-codes branch April 9, 2025 22:36
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Apr 10, 2025
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.