Skip to content

Commit 0f28a5f

Browse files
committed
Add status comments.
1 parent b03bedc commit 0f28a5f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mypy/checkexpr.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5038,17 +5038,18 @@ def check_lst_expr(self, e: ListExpr | SetExpr | TupleExpr, fullname: str, tag:
50385038
if t:
50395039
return t
50405040

5041-
# if a ListExpr, just infer the item type directly
5041+
# try to infer directly
50425042
if isinstance(e, ListExpr):
50435043
item_types = [self.accept(item) for item in e.items]
50445044
if not item_types:
5045-
# empty list, default to Any
50465045
item_type = AnyType(TypeOfAny.from_empty_collection)
50475046
else:
5048-
# attempt to find a common supertype
5047+
# use all the element types
50495048
item_type = self.infer_item_type(item_types)
50505049
return self.chk.named_generic_type(fullname, [item_type])
50515050

5051+
#!BUG this forces all list exprs to be forced (we don't want that)
5052+
50525053
# Translate into type checking a generic function call.
50535054
# Used for list and set expressions, as well as for tuples
50545055
# containing star expressions that don't refer to a

0 commit comments

Comments
 (0)