Skip to content

Commit 3e31189

Browse files
support list and tuple call expr
1 parent 48ebc0d commit 3e31189

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypyc/irbuild/for_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ def get_expr_length(expr: Expression) -> int | None:
12031203
return len(expr.node.final_value)
12041204
elif isinstance(expr, CallExpr) and isinstance(callee := expr.callee, NameExpr):
12051205
fullname = callee.fullname
1206-
if fullname == "builtins.enumerate" and len(expr.args) == 1:
1206+
if fullname in ("builtins.list", "builtins.tuple", "builtins.enumerate") and len(expr.args) == 1:
12071207
return get_expr_length(expr.args[0])
12081208
elif fullname == "builtins.map" and len(expr.args) == 2:
12091209
return get_expr_length(expr.args[1])

0 commit comments

Comments
 (0)