[docs] 2.7.10rc1 operator precedence table order

Jesper Trägårdh jesper.tragardh at gmail.com
Mon May 18 15:12:02 CEST 2015


​​

​Hi Doc Maintainers,



Although I couldn't find a matching issue in the tracker, I thought the
mailing list could be a more appropriate place for this discussion.



With regards to
https://docs.python.org/2/reference/expressions.html#operator-precedence

for Python version 2.7.10rc1 it is stated

The following table summarizes the operator precedences in Python, *from
lowest precedence (least binding) to highest precedence (most binding)*.
(emphasis mine)



I think many programmers coming from other languages actually expect this
table to be in the opposite order, from highest prio to lowest. My
not-so-well-reasearched guess is that how the documentation is layed out in
most other language reference texts and programmers expect to see the
operator evaluated first on the top.



Despite the text I stared for some time at the table trying to understand
why Python would swap the priority of addition and multiplication compared
to the languages with C-like syntax I'm used to. After experimenting with
the interpretor and reading the text again I felt relieved that, actually
it doesn't.



Just my two cents - I don't have a suggestion for how to fix this without
breaking documentation for those already used the current table order.



    Best regards, Jesper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20150518/227e75ba/attachment.html>


More information about the docs mailing list