It seems they are providing the same function, ultimately returning a dict or item through a pipeline or feed. Is there a reason I would use one over the other?
Asked
Active
Viewed 4,753 times
1 Answers
7
In contrast to "return", "yield" doesn't exit the function and continues with the your for-loop. If you use "return", your for-loop will finish after the first iteration.
For more information: What does the "yield" keyword do in Python?

Community
- 1
- 1

Taras Shevchenko
- 104
- 4