mypy icon indicating copy to clipboard operation
mypy copied to clipboard

(😳) no error when instanciating `dict` type alias with invalid type

Open DetachHead opened this issue 3 years ago • 2 comments

from typing import TypeAlias

Values: TypeAlias = dict[str, int]

a = Values(foo="")  # no error

playground

DetachHead avatar Aug 04 '22 00:08 DetachHead

No emoji in the title; didn't read

Seems to only affect dicts kwarg constructor. I can't repro with any other type.

KotlinIsland avatar Aug 04 '22 00:08 KotlinIsland

It seems to only affect dict: playground

KotlinIsland avatar Aug 04 '22 00:08 KotlinIsland