import calendar


def generate_days(year):
    """Generates all tuples (YYYY, MM, DD) of days in a year
    """
    cal = calendar.Calendar()
    days = []
    for m in range(1,13):
        days.extend(list(cal.itermonthdays3(year, m)))
    days = [d for d in set(days) if d[0] == year]
    days.sort()

    return days