title: Python datetime.strptime Default
body: <p>Is there a way to get <code>datetime.strptime()</code> to give me a default value on a failed parse (<code>None</code> in this case)? I have user entered data from a file that could be improperly formatted dates. The dates should be in the form mm/dd/yy, but some people have put them dd/mm/yy. So the file could look like this:</p>
  
  <pre><code>user1 01/30/14
  user2 02/19/12
  user3 27/02/11
  </code></pre>
  
  <p>I don't need to account for the improperly formatted dates, so I can just return <code>None</code>. I know I can do this with:</p>
  
  <pre><code>try:
      return datetime.strptime(row[1], '%m/%d/%y')
  except:
      return None
  </code></pre>
  
  <p>But I'd like to have something a little more gracefully. Is anyone aware of a solution here?</p>
  
  <p>Thanks in advance.</p>