-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
I'm not sure if this should be classified as a missing feature or a bug, but the behavior of the following program is surprising to me:
from mypy_extensions import TypedDict
def foo(x: int, y: int) -> None: pass
OkDict = TypedDict('OkDict', {'x': int, 'y': int})
BadDict1 = TypedDict('BadDict1', {'x': int})
BadDict2 = TypedDict('BadDict2', {'x': int, 'y': str})
a: OkDict
b: BadDict1
c: BadDict2
foo(**a) # Type checks, as expected
foo(**b) # Type checks; should be an error
foo(**c) # Type checks; should be an error
Mypy currently reports no errors with this program; I think we should report an error with the last two calls.
(I'm assuming we're currently ignoring the 'shape' of the TypedDicts and are handling them in the same way we handle Dict?)