What happens if I do not yield
anything to yield from
?
This is an example:
def inner(x):
if x > 0:
yield "Greater than zero"
elif x==0:
yield "Zero"
def outer():
yield from inner(x)
In this case inner(x)
yields something to outer()
if and only if x is >= 0.
What happens if x is negative?