Skip to content

Commit 6cfd442

Browse files
committed
Add status comments.
1 parent 72bdd32 commit 6cfd442

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
@@ -5051,17 +5051,18 @@ def check_lst_expr(self, e: ListExpr | SetExpr | TupleExpr, fullname: str, tag:
50515051
if t:
50525052
return t
50535053

5054-
# if a ListExpr, just infer the item type directly
5054+
# try to infer directly
50555055
if isinstance(e, ListExpr):
50565056
item_types = [self.accept(item) for item in e.items]
50575057
if not item_types:
5058-
# empty list, default to Any
50595058
item_type = AnyType(TypeOfAny.from_empty_collection)
50605059
else:
5061-
# attempt to find a common supertype
5060+
# use all the element types
50625061
item_type = self.infer_item_type(item_types)
50635062
return self.chk.named_generic_type(fullname, [item_type])
50645063

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

0 commit comments

Comments
 (0)