Skip to content

Commit bd42865

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

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mypyc/irbuild/expression.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,13 +1023,18 @@ def dict_literal_values(
10231023
If all keys and values are deeply immutable and constant (including nested dicts as values),
10241024
return the Python dict value. Otherwise, return None.
10251025
"""
1026-
def constant_fold_expr_or_tuple(builder: IRBuilder, expr: Expression) -> ConstantValueTuple | None:
1026+
1027+
def constant_fold_expr_or_tuple(
1028+
builder: IRBuilder, expr: Expression
1029+
) -> ConstantValueTuple | None:
10271030
value = constant_fold_expr(builder, expr)
10281031
if value is not None:
10291032
return value
10301033
if not isinstance(expr, TupleExpr):
10311034
return None
1032-
folded = tuple(const for const in map(constant_fold_expr_or_tuple, expr.items) if const is not None)
1035+
folded = tuple(
1036+
const for const in map(constant_fold_expr_or_tuple, expr.items) if const is not None
1037+
)
10331038
return folded if len(folded) == len(expr.items) else None
10341039

10351040
result = {}

0 commit comments

Comments
 (0)