Skip to content

Commit 8f72b22

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

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mypyc/irbuild/expression.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,11 @@ def transform_index_expr(builder: IRBuilder, expr: IndexExpr) -> Value:
590590

591591
base = builder.accept(expr.base, can_borrow=can_borrow_base)
592592

593-
if isinstance(base.type, RTuple) and isinstance(
594-
folded_index := constant_fold_expr(builder, index), int
595-
) and folded_index >= 0:
593+
if (
594+
isinstance(base.type, RTuple)
595+
and isinstance(folded_index := constant_fold_expr(builder, index), int)
596+
and folded_index >= 0
597+
):
596598
return builder.add(TupleGet(base, folded_index, expr.line))
597599

598600
if isinstance(index, SliceExpr):

0 commit comments

Comments
 (0)