Skip to content

Commit a62ef3a

Browse files
Update constant_fold.py
1 parent 4bcd5d6 commit a62ef3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mypyc/irbuild/constant_fold.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
ConstantValue = Union[int, float, complex, str, bytes]
3939
CONST_TYPES: Final = (int, float, complex, str, bytes)
4040

41-
E = TypeVar("E", Expression)
41+
Expr = TypeVar("Expr", Expression)
4242

4343

4444
def constant_fold_expr(builder: IRBuilder, expr: Expression) -> ConstantValue | None:
@@ -148,16 +148,16 @@ def try_constant_fold(builder: IRBuilder, expr: Expression) -> Value | None:
148148

149149

150150
def folding_candidate(
151-
transform: Callable[[IRBuilder, E], Value],
152-
) -> Callable[[IRBuilder, E], Value]:
151+
transform: Callable[[IRBuilder, Expr], Value],
152+
) -> Callable[[IRBuilder, Expr], Value]:
153153
"""Mark a transform function as a candidate for constant folding.
154154
155155
Candidate functions will attempt to short-circuit the transformation
156156
by constant folding the expression and will only proceed to transform
157157
the expression if folding is not possible.
158158
"""
159159

160-
def constant_fold_wrap(builder: IRBuilder, expr: E) -> Value:
160+
def constant_fold_wrap(builder: IRBuilder, expr: Expr) -> Value:
161161
folded = try_constant_fold(builder, expr)
162162
return folded if folded is not None else transform(builder, expr)
163163

0 commit comments

Comments
 (0)