title: Appending to array while iterating over it
body: <p>I'm trying to create a python script that loops through an array of entries and adds a new day object with a date if that date is not already in the date list.</p>
  
  <pre><code>entryList = [aDate,anotherDate,fooDate]
  history = [aDate]
  
  for entry in entryList:
    for day in history[:]:
      if day.date == entry.date:
        break
      else:
        dayEntry = dayEntry()
        dayEntry.date = entry.date
        history.insert(0,dayEntry)
        break
  </code></pre>
  
  <p>according to this: <a href="https://docs.python.org/3/tutorial/controlflow.html" rel="nofollow noreferrer">https://docs.python.org/3/tutorial/controlflow.html</a> it should work, but I'm missing something.</p>
  
  <p>thanks--</p>