-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
Using mypy 0.782, it looks like overlap is only checked on dictionary keys.
from typing import Dict, overload
class A: pass
class B: pass
@overload
def foo(x: Dict[A, A]) -> A: ...
@overload
def foo(x: Dict[A, B]) -> B: ...
def foo(x):
for k, v in x: return v
raise ValueError
gives error: Overloaded function signatures 1 and 2 overlap with incompatible return types. I get the same error when using Mapping instead of `Dict.
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong