title: Filtering a list containing mixed date formats in Python
body: <p>Say I have a list of dates in python formatted as either <code>YYYY-mm-dd</code> or <code>YYYY-mm</code>.</p>
  <pre class="lang-py prettyprint-override"><code>['2020-08-11', '2020-08-10', '2020-08-09', '2020-08-08', '2020-08-07',
   '2020-08-06', '2020-08-05', '2020-08-04', '2020-08-03', '2020-08-02',
   '2020-08-01', '2020-08', '2020-07', '2020-06', '2020-05', '2020-04',
   '2020-03', '2020-02', '2020-01']
  </code></pre>
  <p>I want to drop any <code>YYYY-mm</code> date from the list, if a more specific date already exists.</p>
  <p>So in the example above, we would need to remove <code>'2020-08'</code> because <code>'2020-08-01'</code> to <code>'2020-08-11'</code> are in the list.</p>
  <p>So the filtered list would be this:</p>
  <pre class="lang-py prettyprint-override"><code>['2020-08-11', '2020-08-10', '2020-08-09', '2020-08-08', '2020-08-07',
   '2020-08-06', '2020-08-05', '2020-08-04', '2020-08-03', '2020-08-02',
   '2020-08-01', '2020-07', '2020-06', '2020-05', '2020-04', '2020-03',
   '2020-02', '2020-01']
  </code></pre>
  <p>Is there an elegant and quick way to accomplish this? Thanks in advance.</p>