title: SQLAlchemy default PostgreSQL ARRAY behavior
body: <p>I have a table I am creating and interacting with using the SQLAlchemy expression engine and I am needing to be able to fetch the values from the <code>ARRAY</code> column as a python <code>tuple</code> not a <code>list</code>. Since the constructor for <code>ARRAY</code> columns allows you to specify if you want the values as tuples, I ended up just reflecting the table out of the database, looking for <code>ARRAY</code> columns, replacing them with an <code>ARRAY</code> column that has the appropriate keyword argument and then using that to construct expressions. Like so:</p>
  
  <pre><code>from sqlalchemy import Table, Column, String, MetaData, select
  
  def swapArrayColumns(table):
      new_cols = []
      for col in table.columns:
          if isinstance(col.type, ARRAY):
              new_cols.append(Column(col.name, ARRAY(String, as_tuple=True)))
          else:
          new_cols.append(Column(col.name, col.type))
      return new_cols
  
  engine = create_engine('postgresql://localhost:5432/dbname')    
  meta = MetaData()
  table = Table('table_name', meta, autoload=True, autoload_with=engine)
  new_cols = swapArrayColumns(table)
  
  # delete old meta since we are re-mapping table
  del meta
  meta = MetaData()
  new_table = Table('table_name', meta, *new_cols)
  
  # Now I can use the new table object to generate expressions
  sel = select([new_table]).where(new_table.c.foo == 'bar')
  rows = list(engine.execute(sel))
  </code></pre>
  
  <p>Since this gets used quite a lot, I'm wondering if there's a more elegant way of accomplishing this same thing perhaps by creating a custom sqlalchemy dialect that just does this for me. All I really want is my <code>ARRAY</code> columns to come back as python <code>tuple</code>s by default.</p>