-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Use _typeshed.NoneType
for the type of None
#11287
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
This is defined correctly in typeshed. @final
class NoneType:
def __bool__(self) -> Literal[False]: ... I'm not sure why mypy is revealing It's possible this was fixed recently in typeshed and mypy hasn't yet picked up the latest version. |
NoneType exists only in 3.10; I don't think mypy uses it to define |
|
None.__bool__()
is bool
not False
_typeshed.NoneType
for the type of None
@JelleZijlstra I'm interested in getting mypy to use Where should I look, I can see that there is a I'm not sure how classes are represented, would this need to be replaced with a |
Yes, I think you'd have to replace |
Currently mypy uses a hardcoded type for
NoneType
, I think it should use the one from typeshed.The text was updated successfully, but these errors were encountered: