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

Method begin_body

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

Source from the content-addressed store, hash-verified

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
718 # lvalue so that it can be referenced by code in the body of the loop.
719 builder = self.builder
720 line = self.line
721 # We unbox here so that iterating with tuple unpacking generates a tuple based
722 # unpack instead of an iterator based one.
723 next_reg = builder.coerce(self.next_reg, self.target_type, line)
724 builder.assign(builder.get_assignment_target(self.index), next_reg, line)
725
726 def gen_step(self) -> None:
727 # Nothing to do here, since we get the next item as part of gen_condition().

Callers

nothing calls this directly

Calls 3

get_assignment_targetMethod · 0.80
coerceMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected