Open this example in the interactive library
Source code
def values():
yield 0
yield from range(1, 4)
print(list(values()))Sample output
[0, 1, 2, 3]

Yield from another iterable. A self-contained example using the Python standard library.
Open this example in the interactive library
def values():
yield 0
yield from range(1, 4)
print(list(values()))[0, 1, 2, 3]