Skip to content

Commit 0c0d582

Browse files
authored
Clarify unpacked type handling in expandtype.py
Add comment to clarify behavior during semantic analysis.
1 parent 1221422 commit 0c0d582

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mypy/expandtype.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ def visit_tuple_type(self, t: TupleType) -> Type:
541541
if isinstance(item, UnpackType):
542542
unpacked = get_proper_type(item.type)
543543
if isinstance(unpacked, Instance):
544+
# expand_type() may be called during semantic analysis, before invalid unpacks are fixed.
544545
if unpacked.type.fullname != "builtins.tuple":
545546
return t.partial_fallback.accept(self)
546547
if t.partial_fallback.type.fullname != "builtins.tuple":

0 commit comments

Comments
 (0)