I used lambda because I think the argument of a function had the property of holding a value.
I do not understand the details of the detailed grammatical evaluation with difficulty, but I was able to successfully prepare a generator that generates a generator by doing the following.
root_gen = ((lambda t: ((t,y) for y in range(3)))(x) for x in range(5))
To evaluate, please use below:
tuple(map(tuple, root_gen))
The original idea is as follows:
# generate a sub generator
def sub_gen(x):
return ((x,y) for y in range(3))
# test
tuple(gen(1))
tuple(gen(2))
# make generator
root_gen = (gen(n) for n in range(5))
# evaluate
tuple(map(tuple(root_gen)))