def generate_next_dates(start_date, offset=0):
 start = (offset * 7)
 for i in itertools.count(start):
  (yield (start_date + timedelta(i)))

def generate_next_dates ( start_date , offset = 0 ) : start = ( offset * 7 ) for i in itertools . count ( start ) : ( yield ( start_date + timedelta ( i ) ) )
generator that returns the next date .