title: SQLAlchemy: How is it that a comma determines if a query returns a String or a Tuple?
body: <p>In SQLAlchemy, if you put a comma in the query as shown below, you get a "string" back. If you don't put a comma, you get a tuple. Why is so? I can't see anywhere that is explained in the documentation</p>
  
  <p>Using SQLAlchemy0.8</p>
  
  <p>Code below returns a <strong>string</strong>:</p>
  
  <pre><code>def get_password(self, member_id):
      for password, in session.query(Member.__table__.c.password).filter(self.__table__.c.id == member_id): 
          return password
  </code></pre>
  
  <p>This returns a <strong>class 'str'</strong>:  <code>'mypassword'</code></p>
  
  <p>While the code below returns a tuple;</p>
  
  <pre><code>def get_password(self, member_id):
      for password in session.query(Member.__table__.c.password).filter(self.__table__.c.id == member_id): 
          return password
  </code></pre>
  
  <p>This returns a <strong>class 'sqlalchemy.util._collections.KeyedTuple'</strong>: <code>('mypassword',)</code></p>