Operator Precedence: One Thing Python Got Right

Steven D'Aprano steve at pearwood.info
Mon Jun 27 08:10:29 EDT 2016


On Mon, 27 Jun 2016 07:53 pm, BartC wrote:

> On 27/06/2016 05:20, Lawrence D’Oliveiro wrote:

>> How did I discover this? Entirely by accident: I forgot the parentheses
>> one day and *didn’t* hit a bug. :)
> 
> That's not wise. It could have worked by chance. And putting in the
> parentheses anyway means the fragment of code stays interchangeable with
> C.

Do you write much Python code that you expect to also be valid C code?


 

-- 
Steven
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.



More information about the Python-list mailing list