[issue8039] precedence rules for ternary operator

2010-03-07 Thread Georg Brandl
Georg Brandl 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: open -> closed

[issue8039] precedence rules for ternary operator

2010-03-06 Thread Meador Inge
Meador Inge 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. -- keywords: +patch nosy: +mi

[issue8039] precedence rules for ternary operator

2010-03-03 Thread Eric Smith
Eric Smith 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. -- nosy: +eric.smith

[issue8039] precedence rules for ternary operator

2010-03-02 Thread Dirkjan Ochtman
Changes by Dirkjan Ochtman : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue8039] precedence rules for ternary operator

2010-03-02 Thread Dirkjan Ochtman
New submission from Dirkjan Ochtman : 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 up to me asking whe