code review

Chris Angelico rosuav at gmail.com
Mon Jul 2 18:55:48 CEST 2012


On Tue, Jul 3, 2012 at 1:16 AM, Rick Johnson
<rantingrickjohnson at gmail.com> wrote:
> py> 1 + 3 * 4
> should ALWAYS equal 16!
>
> With parenthesis only used for grouping:
> py> a + (b*c) + d
>
> Which seems like the most consistent approach to me.

Oh yes, absolutely consistent. Consistency. It's a CR 1/2 monster
found on page 153 of the 3.5th Edition Monster Manual.

Let's see. By your principle, we should evaluate the ** before the - in:

2**-1

Have fun.

ChrisA



More information about the Python-list mailing list