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

Method init

mypyc/irbuild/for_helpers.py:801–811  ·  view source on GitHub ↗
(self, expr_reg: Value, target_type: RType)

Source from the content-addressed store, hash-verified

799 """Generate IR for an async for loop."""
800
801 def init(self, expr_reg: Value, target_type: RType) -> None:
802 # Define targets to contain the expression, along with the
803 # iterator that will be used for the for-loop. We are inside
804 # of a generator function, so we will spill these into
805 # environment class.
806 builder = self.builder
807 iter_reg = builder.call_c(aiter_op, [expr_reg], self.line)
808 builder.maybe_spill(expr_reg)
809 self.iter_target = builder.maybe_spill(iter_reg)
810 self.target_type = target_type
811 self.stop_reg = Register(bool_rprimitive)
812
813 def gen_condition(self) -> None:
814 # This does the test and fetches the next value

Callers 1

make_for_loop_generatorFunction · 0.95

Calls 3

RegisterClass · 0.90
maybe_spillMethod · 0.80
call_cMethod · 0.45

Tested by

no test coverage detected