title: Newbie Python Question about tuples
body: <p>I am new to Python, and I'm working on writing some database code using the <code>cx_Oracle</code> module.  In the <a href="http://cx-oracle.sourceforge.net/html/module.html" rel="nofollow noreferrer">cx_Oracle documentation</a> they have a code example like this:</p>
  
  <pre><code>import sys
  import cx_Oracle
  
  connection = cx_Oracle.Connection("user/pw@tns")
  cursor = connection.cursor()
  
  try:
      cursor.execute("select 1 / 0 from dual")
  except cx_Oracle.DatabaseError, exc:
      error, = exc.args
      print &gt;&gt; sys.stderr, "Oracle-Error-Code:", error.code
      print &gt;&gt; sys.stderr, "Oracle-Error-Message:", error.message
  </code></pre>
  
  <p>My question has to do with where the "error" object is created.  What does the "<code>, =</code>" do?  I tried searching Python documentation, and search engines don't work very well when you're searching for operators.   :-)</p>
  
  <p>I know that the exc.args is a singleton tuple, but I just don't understand the "<code>, =</code>" syntax.  If I remove the comma, I get the error message, "<code>AttributeError: 'tuple' object has no attribute 'code'</code>".  </p>
  
  <p>Can someone point me to where this is documented?  Thanks!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This works without having to unpack the tuple:</p>
  
  <pre><code>import sys
  import cx_Oracle
  
  connection = cx_Oracle.Connection("user/pw@tns")
  cursor = connection.cursor()
  
  try:
      cursor.execute("select 1 / 0 from dual")
  except cx_Oracle.DatabaseError, exc:
      print &gt;&gt; sys.stderr, "Oracle-Error-Code:", exc.args[0].code
      print &gt;&gt; sys.stderr, "Oracle-Error-Message:", exc.args[0].message
  </code></pre>