title: SQLAlchemy: Check if a given value is in a list
body: <h1>The problem</h1>
  
  <p>In PostgreSQL, checking whether a field is in a given list is done using the <code>IN</code> operator:</p>
  
  <pre><code>SELECT * FROM stars WHERE star_type IN ('Nova', 'Planet');
  </code></pre>
  
  <p><strong>What is the SQLAlchemy equivalent for an <code>IN</code> SQL query?</strong></p>
  
  <h1>What have I tried</h1>
  
  <h2>Python's <code>in</code></h2>
  
  <pre><code>db_session.query(Star).filter(Star.star_type in ('Nova', 'Planet'))
  </code></pre>
  
  <p>The query returns empty.</p>
  
  <h2>SQLAlchemy's <code>or_</code></h2>
  
  <pre><code>db_session.query(Star).\
             filter(or_(
                        Star.star_type == 'Nova', 
                        Star.star_type == 'Planet'
             ))
  </code></pre>
  
  <p>This query returns the right result, but it is not elegant and hard to expand.</p>