You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#2887. Fixes#3191.
In addition this prohibits reassigning aliases. Previously something like
this was allowed:
```
if random():
Alias = Sequence[int]
else:
Alias = Sequence[float]
def fun(arg: Alias) -> None:
...
```
Now this will generate an error:
Cannot assign multiple types to name "Alias" without an explicit "Type[...]"
annotation.
See #3494 for background.
Finally, this simplifies the logic in semanal.py, so that most processing of type aliases
happens in one function.
The following snippet fails with
5: error: Invalid type "T"
with mypy 0.501 on Python 3.5.2.This is similar to #1637 and was originally discussed there.
The text was updated successfully, but these errors were encountered: