The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Mar 21 14:18:41 EDT 2016


On 21/03/2016 17:31, BartC wrote:
>
> (While I here, something that came up yesterday: why hasn't Python fixed
> the bug it seems to have inherited from C, where:
>
>    a << b + c
>
> is evaluated as 'a << (b+c)'? That cost me half an hour to sort out! <<
> and >> scale numbers just like * and /, so should have the same
> precedence.)
>

Python is not C.  This is not a bug.  The rules are here 
https://docs.python.org/3/reference/expressions.html#operator-precedence

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list