Apr-19-2024, 01:22 PM
yield from is for yielding values produced by another generator. Instead of this
https://peps.python.org/pep-0380/
for i in range(10): yield iYou can now do this:
yield range(10)But this isn't just a shorthand way of writing a generator. The reasons for yield from are discribed in this pep
https://peps.python.org/pep-0380/