title: Sort when values are None or empty strings python
body: <p>I have a list with dictionaries in which I sort them on different values. I'm doing it with these lines of code:</p>
  
  <pre><code>def orderBy(self, col, dir, objlist):
      if dir == 'asc':
          sorted_objects = sorted(objlist, key=lambda k: k[col])
      else:
          sorted_objects = sorted(objlist, key=lambda k: k[col], reverse=True)
      return sorted_objects
  </code></pre>
  
  <p>Now the problem is that I occasionally have null values or empty strings when I try to sort and then it all breaks down.</p>
  
  <p>I'm not sure but i think that this is the exception that's thrown: unorderable types: NoneType() &lt; NoneType(). It occurs when there is None values on the column I'm trying to sort. For empty string values it works although they end up first in the list but I would like them to be last.</p>
  
  <p>How can I solve this problem?</p>