
Oct. 17, 2021
3:08 p.m.
On Oct 17, 2021, at 3:40 AM, Serhiy Storchaka <storchaka@gmail.com> wrote:
16.10.21 17:07, Erik Demaine пише:
(*it for it in its) # tuple with the concatenation of iterables in 'its'
As others already have said, it should evaluate to a generator, not to a tuple.
But other question is occurred now. Should it be equivalent to
def gen(its): for it in its: for x in it: yield x
or to
def gen(its): for it in its: yield from it
? There is a subtle difference between these codes.
Serhiy: could you explain the difference? Eric