-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: typing doesn't handle type aliases via Python types #21900
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
Comments
@bibhabasumohapatra you're looking at the runtime type. This bug is about static typing. |
Yes, looks like mypy issue. Sorry for misunderstanding. Should check the source more. |
As was noted by @bmerry, this is a duplicate of #19252 and I’d suggest keep this discussion contained to that issue. But to summarise: it’s non-trivial to map |
Describe the issue:
numpy 1.20 encouraged specifying plain
bool
as a dtype as an equivalent tonp.bool_
, but these aliases don't behave the same as the explicit numpy versions. mypy infers the dtype as "Any" instead. See the example below, where I expected both lines to output the same type.Reproduce the code example:
Error message:
The text was updated successfully, but these errors were encountered: