I\'m curious about the difference between using raise StopIteration and a return statement in generators.
For example, is there any differe
That's true, they are equivalent except that one is readable whereas the other is obscure. This dates back to the very first version of generators (PEP 255, under "Specification: Return"), and the subsequent enhancements of (such as coroutines) do not change this. 3.3's yield from (PEP 380) extends that to return as syntactic sugar for raise StopIteration(, but that doesn't change the meaning of return;.