
C. Titus Brown wrote:
over on the pygr list, we were recently discussing a mildly confusing edit I made:
assert 'seq1' in self.db, self.db.keys()
This was interpreted by someone as being
assert 'seq1' in (self.db, self.db.keys())
which is very different from the actual meaning,
assert ('seq1' in self.db), self.db.keys()
where 'self.db.keys()' serves as the message to be printed out when the assertion fails. Apart from questions of why I was apparently out to confuse people with this edit, the question of ',' precedence came up. Looking at
http://docs.python.org/ref/summary.html
there's no mention of ',' binding and tuple creation vs the other operators.
A bare "," is part of the "expression list" syntax; it's not an operator: http://docs.python.org/ref/exprlists.html You have to look at the statement descriptions to find out whether a statement wants an expression or an expression list (e.g. "return" takes an expression list, while "assert" takes two expressions, not two expression lists). </F>