MCPcopy Index your code
hub / github.com/RustPython/RustPython / _gen3

Function _gen3

Lib/test/test_generators.py:1965–1984  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

1963 # gen's use.
1964
1965 def _gen3(i):
1966 assert i < n and (n-i) % 3 == 0
1967 ip1, ip2, ip3 = i+1, i+2, i+3
1968 g, g1, g2 = gs[i : ip3]
1969
1970 if ip3 >= n:
1971 # These are the last three, so we can yield values directly.
1972 for values[i] in g():
1973 for values[ip1] in g1():
1974 for values[ip2] in g2():
1975 yield values
1976
1977 else:
1978 # At least 6 loop nests remain; peel off 3 and recurse for the
1979 # rest.
1980 for values[i] in g():
1981 for values[ip1] in g1():
1982 for values[ip2] in g2():
1983 for x in _gen3(ip3):
1984 yield x
1985
1986 for x in gen(0):
1987 yield x

Callers 1

genFunction · 0.85

Calls 3

g1Function · 0.85
g2Function · 0.85
gFunction · 0.70

Tested by

no test coverage detected