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

Method init

mypyc/irbuild/for_helpers.py:1251–1261  ·  view source on GitHub ↗
(self, indexes: list[Lvalue], exprs: list[Expression])

Source from the content-addressed store, hash-verified

1249 return True
1250
1251 def init(self, indexes: list[Lvalue], exprs: list[Expression]) -> None:
1252 assert len(indexes) == len(exprs)
1253 # Condition check will require multiple basic blocks, since there will be
1254 # multiple conditions to check.
1255 self.cond_blocks = [BasicBlock() for _ in range(len(indexes) - 1)] + [self.body_block]
1256 self.gens: list[ForGenerator] = []
1257 for index, expr, next_block in zip(indexes, exprs, self.cond_blocks):
1258 gen = make_for_loop_generator(
1259 self.builder, index, expr, next_block, self.loop_exit, self.line, nested=True
1260 )
1261 self.gens.append(gen)
1262
1263 def gen_condition(self) -> None:
1264 for i, gen in enumerate(self.gens):

Callers 2

make_for_loop_generatorFunction · 0.95
initMethod · 0.45

Calls 6

BasicBlockClass · 0.90
lenFunction · 0.85
rangeClass · 0.85
zipFunction · 0.85
make_for_loop_generatorFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected