[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Operator precedence problem

On Tue, Jun 7, 2016 at 1:27 AM, Jon Ribbens
<jon+usenet at> wrote:
>>> You should put brackets around expressions when it's at all unclear
>>> what the meaning is. You could think of them a bit like "active
>>> comments" I suppose.
>> Your code should keep noise to the minimum.
> Sensible and beneficial comments aren't "noise".

In that case, please never insult the intelligence of your future
readers by including any of these parentheses:

x = 1 + (2 * 3)
value = 77 if (x % 2) else (70*7)

And if your readers have to figure out what 3**3**3 is interpreted as,
there should be an interactive interpreter around. Or here - try
something cute:

>>> 2**2**-1