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

Function go

mypyc/irbuild/expression.py:945–958  ·  view source on GitHub ↗
(i: int, prev: Value)

Source from the content-addressed store, hash-verified

943 # go(i, prev) generates code for `ei opi e{i+1} op{i+1} ... en`,
944 # assuming that prev contains the value of `ei`.
945 def go(i: int, prev: Value) -> Value:
946 if i == len(e.operators) - 1:
947 return transform_basic_comparison(
948 builder, e.operators[i], prev, builder.accept(e.operands[i + 1]), e.line
949 )
950
951 next = builder.accept(e.operands[i + 1])
952 return builder.builder.shortcircuit_helper(
953 "and",
954 expr_type,
955 lambda: transform_basic_comparison(builder, e.operators[i], prev, next, e.line),
956 lambda: go(i + 1, next),
957 e.line,
958 )
959
960 return go(0, builder.accept(e.operands[0]))
961

Callers 1

Calls 4

lenFunction · 0.85
shortcircuit_helperMethod · 0.80
acceptMethod · 0.45

Tested by

no test coverage detected