-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[Request]: Warn for None types then using Union[None, ...] #7258
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
That code should already throw an error in mypy. Are you seeing that it doesn't? |
Yes. It's true, but when you do type check like this:
It still prints an error:
Then this is, instead of a feature request, an bugfix? EDIT: |
Mypy doesn't recognize |
Created #7260 to discuss what we should do about this (if anything). |
I think it'll be a good idea to warn the developer to check for None types when he/she indicate that the types of the variable can be None. Like this:
Or something like that...
The text was updated successfully, but these errors were encountered: