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

Method init

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

Source from the content-addressed store, hash-verified

996 return True
997
998 def init(self, expr_reg: Value, target_type: RType) -> None:
999 builder = self.builder
1000 self.target_type = target_type
1001
1002 # We add some variables to environment class, so they can be read across yield.
1003 self.expr_target = builder.maybe_spill(expr_reg)
1004 offset = Integer(0)
1005 self.offset_target = builder.maybe_spill_assignable(offset)
1006 self.size = builder.maybe_spill(self.load_len(self.expr_target))
1007
1008 # For dict class (not a subclass) this is the dictionary itself.
1009 iter_reg = builder.call_c(self.dict_iter_op, [expr_reg], self.line)
1010 self.iter_target = builder.maybe_spill(iter_reg)
1011
1012 def gen_condition(self) -> None:
1013 """Get next key/value pair, set new offset, and check if we should continue."""

Callers

nothing calls this directly

Calls 5

IntegerClass · 0.90
maybe_spillMethod · 0.80
load_lenMethod · 0.80
call_cMethod · 0.45

Tested by

no test coverage detected