Is there any way to mix recursion and the yield statement? For instance, a infinite number generator (using recursion) would be something like:
yield
So basically you just need to add a for loop at where you need to call your function recursively. This applies for Python 2.7.