| 704 | self.target_type = target_type |
| 705 | |
| 706 | def gen_condition(self) -> None: |
| 707 | # We call __next__ on the iterator and check to see if the return value |
| 708 | # is NULL, which signals either the end of the Iterable being traversed |
| 709 | # or an exception being raised. Note that Branch.IS_ERROR checks only |
| 710 | # for NULL (an exception does not necessarily have to be raised). |
| 711 | builder = self.builder |
| 712 | line = self.line |
| 713 | self.next_reg = builder.call_c(next_op, [builder.read(self.iter_target, line)], line) |
| 714 | builder.add(Branch(self.next_reg, self.loop_exit, self.body_block, Branch.IS_ERROR)) |
| 715 | |
| 716 | def begin_body(self) -> None: |
| 717 | # Assign the value obtained from __next__ to the |