title: SQLAlchemy raw SQL parameter substitution with an IN clause
body: <p>I have an SQL statement, <code>SELECT foo FROM bar WHERE id IN %s</code>. I have a list of integers, e.g. <code>[1, 2, 3]</code> and I'd like this to get turned into a SQL statement that looks like <code>SELECT foo FROM bar WHERE id IN (1, 2, 3)</code>.</p>
  
  <p>I use SQLAlchemy Core for its connection pooling and for making some inserts with multiple <code>VALUES</code> clauses easier to write and maintain. I prefer to write most of my queries in raw SQL.</p>
  
  <p>To do this in Pyscopg2 I do <code>cursor.execute('SELECT .. WHERE IN %s', (tuple(my_list),))</code>. I can't manage to make this work in SQLAlchemy, however.</p>
  
  <p><code>engine.execute('SELECT ... WHERE IN %s', tuple(my_list))</code> raises an exception: TypeError: not all arguments converted during string formatting. This same exception is raised if I pass just the list, not wrapped in a tuple.</p>
  
  <p>If I use named parameters like <code>engine.execute('SELECT ... WHERE id IN :ids', ids=my_list)</code> I get a <code>ProgrammingError</code> exception because SQLAlchemy creates incorrect SQL: <code>SELECT * FROM foo WHERE id IN :ids</code> (it doesn't substitute the :ids value for my variable). This same exception is raised if I pass a tuple.</p>
  
  <p>How can I use a <code>WHERE IN()</code> clause using raw SQL in SQLAlchemy?</p>