0 + not 0

random832 at fastmail.us random832 at fastmail.us
Sat Jul 11 16:46:29 EDT 2015


On Sat, Jul 11, 2015, at 07:20, Chris Angelico wrote:
> On Sat, Jul 11, 2015 at 9:12 PM, Luuk <luuk at invalid.lan> wrote:
> > It can occur in an arithmetic expression, and 'not' has a higher precedence
> > than '+'
> > (https://docs.python.org/2/reference/expressions.html#operator-precedence)
> >
> 
> I think you're misreading the table; 'not' has *lower* precedence than
> '+'.

Precedence shouldn't actually matter when resolving a unary prefix
operator on the right of a binary operator. I don't understand how this
could possibly be interpreted in a different valid way rather than being
spuriously rejected as a syntax error.



More information about the Python-list mailing list