Skip to content

Commit f6f98e4

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a64f2e4 commit f6f98e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mypyc/irbuild/for_helpers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,11 @@ def get_expr_length(expr: Expression) -> int | None:
12251225
arg_lengths = [get_expr_length(arg) for arg in expr.args]
12261226
if all(arg is not None for arg in arg_lengths):
12271227
return min(arg_lengths) # type: ignore [type-var]
1228-
elif fullname == "builtins.range" and len(expr.args) <= 3 and all(isinstance(arg, IntExpr) for arg in expr.args):
1228+
elif (
1229+
fullname == "builtins.range"
1230+
and len(expr.args) <= 3
1231+
and all(isinstance(arg, IntExpr) for arg in expr.args)
1232+
):
12291233
return len(range(*(arg.value for arg in expr.args))) # type: ignore [attr-defined]
12301234

12311235
# TODO: extend this, passing length of listcomp and genexp should have worthwhile

0 commit comments

Comments
 (0)