You can simply find the smallest and largest numbers that have squares in the specified range. Then you can return the squares of every number in that range.
import math
def perfect_squares(min, max):
lowest = int(math.ceil(math.sqrt(min)))
highest = int(math.sqrt(max))
return (n**2 for n in range(lowest, highest + 1))