Operator: inappropriate wording?

elas tica elasstiika at gmail.com
Mon Oct 31 17:09:26 EDT 2022


Le mercredi 26 octobre 2022 à 22:12:59 UTC+2, Weatherby,Gerard a ecrit :
> No. If the docs say in one place a comma is not an operator, they shouldn’t call it an operator in another place. 
> 
> I’ve submitted a pull request https://github.com/python/cpython/pull/98736 -- we’ll have to see what The Powers That Be think.


Thanks for the (merged) pull request about the "comma operator"!

I return to the last two quotes in the Reference Document regarding these so-called "assignment operators".

The entry in the glossary explains that the comma symbol is not an operator. Well, I just realized that this same entry also explains that the = symbol is not an operator, as you can see by reading the end of their response:

The same is true of the various assignment operators (=, += etc). They are not truly operators but syntactic delimiters in assignment statements.

(glossary entry link: https://docs.python.org/3/faq/programming.html#what-s-up-with-the-comma-operator-s-precedence)

Talking about an assignment operator in Python is even more confusing because, since Python 3.8, there is a real assignment operator, namely the walrus operator. As explained above, the correct expression would be "assignement delimiter" or "assignement statement" or "assignement symbol".


By the way, Alex Martelli shares this view, explaining:

The "=" operator in Python ... doesn't exist, since '=' is not an operator in Python (just like it isn't, say, in VB). But, OK, you mean "assignment".

(source: https://groups.google.com/g/comp.lang.python/c/K6HfK6HANR4/m/OG9QBzFmTR8J)


More information about the Python-list mailing list