Re: Ternary operator associativity

2014-03-06 Thread Terry Reedy
On 3/6/2014 1:59 PM, Tim Chase wrote: On 2014-03-06 03:34, candide wrote: According to the official documentation, the ternary operator has left-to-right associativity left_to_right = (0 if 1 else 0) if 0 else 1 right_to_left = 0 if 1 else (0 if 0 else 1) I'd never want to rely on my own abi

Re: Ternary operator associativity

2014-03-06 Thread Tim Chase
On 2014-03-06 03:34, candide wrote: > According to the official documentation, the ternary operator has > left-to-right associativity > > >>> left_to_right = (0 if 1 else 0) if 0 else 1 > >>> right_to_left = 0 if 1 else (0 if 0 else 1) I'd never want to rely on my own ability to remember the lang

Re: Ternary operator associativity

2014-03-06 Thread Terry Reedy
On 3/6/2014 6:34 AM, candide wrote: According to the official documentation, the ternary operator has left-to-right associativity : The proper terms is 'conditional expression', which goes back to "The C Programming Language" (K&R). There are many unary operators, many binary operators, and t

Re: Ternary operator associativity

2014-03-06 Thread Michael Torrie
On 03/06/2014 04:34 AM, candide wrote: > According to the official documentation, the ternary operator has > left-to-right associativity : > > --- > Operators in the same box group left to right (except for comparisons, > including tests, which all have the same precedence and ch