We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f4ef4d commit a64f2e4Copy full SHA for a64f2e4
mypyc/irbuild/for_helpers.py
@@ -1225,7 +1225,7 @@ def get_expr_length(expr: Expression) -> int | None:
1225
arg_lengths = [get_expr_length(arg) for arg in expr.args]
1226
if all(arg is not None for arg in arg_lengths):
1227
return min(arg_lengths) # type: ignore [type-var]
1228
- elif fullname == "builtins.range" and all(isinstance(arg, IntExpr) for arg in expr.args):
+ elif fullname == "builtins.range" and len(expr.args) <= 3 and all(isinstance(arg, IntExpr) for arg in expr.args):
1229
return len(range(*(arg.value for arg in expr.args))) # type: ignore [attr-defined]
1230
1231
# TODO: extend this, passing length of listcomp and genexp should have worthwhile
0 commit comments