MyPy fails with TypeAlias?

103 Views Asked by At

MyPy (v 1.1.0) appears to fail with TypeAlias.

StrBytes: TypeAlias = str | bytes
var: type[StrBytes] = StrBytes

Is signaled by mypy with the following error:

error: Incompatible types in assignment (expression has type 
"<typing special form>", variable has type "type[str] | type[bytes]")

Is this a bug with mypy?

0

There are 0 best solutions below