MCPcopy Index your code
hub / github.com/python/mypy / gen_condition

Method gen_condition

mypyc/irbuild/for_helpers.py:706–714  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

BranchClass · 0.90
call_cMethod · 0.45
readMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected