I know it never use to write several return
statements sequentially bc the second one will be unreachable, eg:
def return_something():
return 2
return "Kolia" # unreachable
But if there any use to write several yield
statement sequentially?
def yield_something():
yield 3
yield 4
print(next(yield_something()))
print(next(yield_something()))
>>> 3
>>> 3
Seems to me I have seen somewhere use of sequential yield
and my IDE doesn't highlighting it. Could anyone expose to me use of sequential yield
?