@@ -541,7 +541,7 @@ def translate_sum_call(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> V
541541 acc_rtype = int_rprimitive
542542 elif is_object_rprimitive (item_rtype ) and is_int_rprimitive (start_rtype ):
543543 acc_rtype = object_rprimitive
544-
544+
545545 else :
546546 # escape hatch, maybe figure out a better way to handle this whole block
547547 # seeking ideas in review
@@ -551,17 +551,16 @@ def translate_sum_call(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> V
551551 builder .assign (retval , builder .coerce (builder .accept (start_expr ), acc_rtype , - 1 ), - 1 )
552552
553553 if isinstance (arg , GeneratorExpr ):
554+
554555 def gen_inner_stmts () -> None :
555556 call_expr = builder .accept (arg .left_expr )
556557 builder .assign (retval , builder .binary_op (retval , call_expr , "+" , - 1 ), - 1 )
557558
558- loop_params = list (
559- zip (arg .indices , arg .sequences , arg .condlists , arg .is_async )
560- )
559+ loop_params = list (zip (arg .indices , arg .sequences , arg .condlists , arg .is_async ))
561560 comprehension_helper (builder , loop_params , gen_inner_stmts , arg .line )
562561
563562 return retval
564-
563+
565564 else :
566565 index_name = "__mypyc_sum_item__"
567566
@@ -573,15 +572,7 @@ def body_insts() -> None:
573572 index = _create_iterable_lexpr (index_name , index_type )
574573 index_reg = builder .add_local_reg (index .node , builder .type_to_rtype (index_type ))
575574
576- for_loop_helper (
577- builder ,
578- index ,
579- arg ,
580- body_insts ,
581- None ,
582- is_async = False ,
583- line = expr .line ,
584- )
575+ for_loop_helper (builder , index , arg , body_insts , None , is_async = False , line = expr .line )
585576 return retval
586577
587578
0 commit comments