<div dir="ltr"><div>Question about 'yield from'.</div><div><br></div><div>I understand that::</div><div><br></div><div>    yield from xs</div><div><br></div><div>is syntax suger of::</div><div><br></div><div>    for x in xs:</div>
<div>      yield x</div><div><br></div><div>And::</div><div><br></div><div>    val = yield from xs</div><div><br></div><div>is same as::</div><div><br></div><div>    for x in xs:</div><div>      ret = yield x</div><div>    val = ret</div>
<div><br></div><div>Is it true? Do I understand correctly?</div><div><br></div><div><br></div><div>quote from <a href="https://docs.python.org/3/whatsnew/3.3.html#pep-380-syntax-for-delegating-to-a-subgenerator">https://docs.python.org/3/whatsnew/3.3.html#pep-380-syntax-for-delegating-to-a-subgenerator</a></div>
<div>> For simple iterators, yield from iterable is essentially</div><div>> just a shortened form of for item in iterable: yield item:</div><div><br></div><div>--</div><div>regards,</div><div>kwatch</div></div>