28 Aug
2017
28 Aug
'17
4:56 p.m.
Yury Selivanov wrote:
I saying that the following should not work:
def nested_gen(): set_some_context() yield
def gen(): # some_context is not set yield from nested_gen() # use some_context ???
And I'm saying it *should* work, otherwise it breaks one of the fundamental principles on which yield-from is based, namely that 'yield from foo()' should behave as far as possible as a generator equivalent of a plain function call. -- Greg