I am doing some weird things with python interpreter and I would like to understand the following.
My first question is: can yielded_generator.gi_frame.f_back return anything but None? Example?
My second question is about the value stack of yielded generators. Can I construct a pure-python code that will have anything on the value stack after the generator yields? Maybe some sort of a lambda expression?
It is not clear what kind of code is ‘yielded_generator’. Some code example would help.
But generally, generators are sometimes used to avoid having to create long lists of values to be returned in the future. For example range(9999) would be implemented as a generator to avoid having to store the 9,999 values for later use. So there may be no value stack depending on how the generator was implemented