title: Use a list in prepared statement
body: <p>I want to use a Python <code>list</code> (or a <code>set</code> actually) in my <code>execute</code>, but I don't quite get it.</p>
  
  <pre><code>BRANDS = {
    'toyota',
    'ford',
    'dodge',
    'spyker'
  }
  
  cur = connection.cursor()
  cur.execute("SELECT model FROM cars WHERE brand IN (%s)", (list(BRANDS),)
  </code></pre>
  
  <p>How can I use a <code>set</code> or <code>list</code> in an <code>IN</code> clause in psycopg2?</p>