On Sat, Jul 11, 2015 at 8:26 PM, candide <c.cand...@laposte.net> wrote: >>>> 0 + not 0 > File "<stdin>", line 1 > 0 + not 0 > ^ > SyntaxError: invalid syntax >>>> > > > What is syntactically wrong with 0 + not 0?
I'm actually not sure why this can't be handled. Possibly it's a limitation of the parser. Certainly 0 + (not 0) works just fine. This suggests that the exponentiation operator may have been special-cased to cope with this: https://docs.python.org/3/reference/expressions.html#id21 So maybe there's just no corresponding special case for this - which, I have to say, is not exactly a common construct. ChrisA -- https://mail.python.org/mailman/listinfo/python-list