-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-0-high
Description
from typing import Hashable
def f() -> Hashable:
return None
print(isinstance(None, Hashable))The print returns True, so Python understands that None is hashable, but MyPy complains about incompatible return types:
error: Incompatible return value type (got "None", expected "Hashable")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-0-high