title: Elegant way to filter by none or not none
body: <p>The following SQLAlchemy code works, but looks un-pythonic:</p>
  
  <pre><code>if has_died: # has_died: True or False
    query = query.filter(User.died_at != None)
  else:
    query = query.filter(User.died_at == None)
  </code></pre>
  
  <p>What is a more elegant way to add the filter?</p>