title: Can I get rows from SQLAlchemy that are plain arrays, rather than dictionaries?
body: <p>I'm trying to optimize some Python code. The profiler tells me that SQLAlchemy's _get_col() is what's killing performance. The code looks something like this:</p>
  
  <pre><code>lots_of_rows = get_lots_of_rows()
  for row in lots_of_rows:
      if row.x == row.y:
          print row.z
  </code></pre>
  
  <p>I was about to go through the code and make it more like this...</p>
  
  <pre><code>lots_of_rows = get_lots_of_rows()
  for row in lots_of_rows:
      if row[0] == row[1]:
          print row[2]
  </code></pre>
  
  <p>...but I've found some documentation that seems to indicate that when accessing row objects like arrays, you're actually still pulling dictionary keys. In other words, the row object looks like this:</p>
  
  <pre><code>'x': (x object)
  '0': (x object)
  'y': (y object)
  '1': (y object)
  'z': (z object)
  '2': (z object)
  </code></pre>
  
  <p>If that's the case, I doubt I'll see any performance improvement from accessing columns by number rather than name. Is there any way to get SA to return results as a list of tuples, or a list of lists, rather than a list of dictionaries? Alternately, can anyone suggest any other optimizations?</p>