Vladimir

59%
Flag icon
It’s confusing to say a generator “returns” values. Functions return values. Calling a generator function returns a generator. A generator yields values. A generator doesn’t “return” values in the usual way: the return statement in the body of a generator function causes StopIteration to be raised by the generator object.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview