[issue8039] precedence rules for ternary operator

2010-03-07 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: if-else actually was already documented, under boolean expressions. It was merely missing from the precendence table. I've now given it its own section, to make it stand out a bit better. See r78772. -- resolution: - fixed status:

[issue8039] precedence rules for ternary operator

2010-03-06 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: It seems to me from the grammar (http://docs.python.org/reference/expressions.html#grammar-token-conditional_expression) that the precedence for conditional expressions fall in between that of 'lambda' and 'or' expressions. --

[issue8039] precedence rules for ternary operator

2010-03-03 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: For what it's worth, these are properly called Conditional Expressions. See PEP 308 for the gory details, including figuring out what the precedence is. It was news to me that the allowed syntax is slightly different in 2.x and 3.x. --

[issue8039] precedence rules for ternary operator

2010-03-02 Thread Dirkjan Ochtman
New submission from Dirkjan Ochtman dirk...@ochtman.nl: So http://docs.python.org/reference/expressions.html doesn't currently mention the ternary operator as far as I can see. Maybe this is trivial, but it would be nice to know where it fits into the hierarchy. (I.e., my co-worker just came

[issue8039] precedence rules for ternary operator

2010-03-02 Thread Dirkjan Ochtman
Changes by Dirkjan Ochtman dirk...@ochtman.nl: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8039 ___ ___ Python-bugs-list