File tree Expand file tree Collapse file tree 2 files changed +11
-16
lines changed
Expand file tree Collapse file tree 2 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -2496,18 +2496,12 @@ T() # E: "TypeVar" not callable
24962496[case testStringDisallowedUnpacking]
24972497d: dict[str, str]
24982498
2499- for a1, b1 in d: # E: Unpacking a string is disallowed \
2500- # E: "str" object is not iterable
2501- reveal_type(a1) # E: Cannot determine type of "a1" \
2502- # N: Revealed type is "Any"
2503- reveal_type(b1) # E: Cannot determine type of "b1" \
2504- # N: Revealed type is "Any"
2499+ for a1, b1 in d: # E: Unpacking a string is disallowed
2500+ reveal_type(a1) # N: Revealed type is "builtins.str"
2501+ reveal_type(b1) # N: Revealed type is "builtins.str"
25052502
25062503s = "foo"
2507- a2, b2 = s # E: Unpacking a string is disallowed \
2508- # E: "str" object is not iterable
2509- reveal_type(a2) # E: Cannot determine type of "a2" \
2510- # N: Revealed type is "Any"
2511- reveal_type(b2) # E: Cannot determine type of "b2" \
2512- # N: Revealed type is "Any"
2513- [builtins fixtures/dict.pyi]
2504+ a2, b2 = s # E: Unpacking a string is disallowed
2505+ reveal_type(a2) # N: Revealed type is "builtins.str"
2506+ reveal_type(b2) # N: Revealed type is "builtins.str"
2507+ [builtins fixtures/primitives.pyi]
Original file line number Diff line number Diff line change @@ -725,9 +725,10 @@ bad: Union[int, str]
725725
726726x, y = bad # E: "int" object is not iterable \
727727 # E: Unpacking a string is disallowed
728- reveal_type(x) # N: Revealed type is "Any"
729- reveal_type(y) # N: Revealed type is "Any"
730- [out]
728+ reveal_type(x) # N: Revealed type is "Union[Any, builtins.str]"
729+ reveal_type(y) # N: Revealed type is "Union[Any, builtins.str]"
730+ [builtins fixtures/primitives.pyi]
731+
731732
732733[case testUnionAlwaysTooMany]
733734from typing import Union, Tuple
You can’t perform that action at this time.
0 commit comments