I know there is generator yield in python like:
def f(n):
x = n
while True:
yield x
x = x+1
So I try to convert this haskell function into python without using iterate: Haskell infinite recursion in list comprehension
I'm not sure how to define base case in python, also not sure how to combine if statement with this yield staff! here is what I try to do:
def orbit(x,y):
while True:
yield p (u,v)
p (u,v) = (u^2 - v^2 + x, 2 * u * v + y)