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
I just checked, it looks like this is another multi-assign from Union problem. @elazarg I think this is an important feature, and it would be great if you will continue working on your PR.
Fixes#3859Fixes#3240Fixes#1855Fixes#1575
This is a simple fix of various bugs and a crash based on the idea
originally proposed in #2219. The idea is to check assignment for
every item in a union. However, in contrast to #2219, I think it will
be more expected/consistent to construct a union of the resulting
types instead of a join, for example:
```
x: Union[int, str]
x1 = x
reveal_type(x1) # Revealed type is 'Union[int, str]'
y: Union[Tuple[int], Tuple[str]]
(y1,) = y
reveal_type(y1) # Revealed type is 'Union[int, str]'
```
@elazarg did the initial work on this.
The code
yields
error: 'Union[Tuple[builtins.int*, builtins.int*], Tuple[builtins.str*, builtins.str*]]' object is not iterable
Using just Dict[str, str] instead of the Union passes.
The code (naturally) runs in python, and both elements in the union are iterable...
The text was updated successfully, but these errors were encountered: