MCPcopy Index your code
hub / github.com/python/cpython / simple_conjoin

Function simple_conjoin

Lib/test/test_generators.py:1911–1924  ·  view source on GitHub ↗
(gs)

Source from the content-addressed store, hash-verified

1909# each slot depend on the values iterated at previous slots.
1910
1911def simple_conjoin(gs):
1912
1913 values = [None] * len(gs)
1914
1915 def gen(i):
1916 if i >= len(gs):
1917 yield values
1918 else:
1919 for values[i] in gs[i]():
1920 for x in gen(i+1):
1921 yield x
1922
1923 for x in gen(0):
1924 yield x
1925
1926# That works fine, but recursing a level and checking i against len(gs) for
1927# each item produced is inefficient. By doing manual loop unrolling across

Callers

nothing calls this directly

Calls 1

genFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…