Can you think of ANY context in Python in which the order of items in parentheses isn't important?!

(a, b, c) != (c, b, a)

func(a, b, c) != func(c, b, a)

etc.

You are arguing that defining inheritance order is "intuitively" the one and only context in which the order of items in parentheses makes no difference.



On Sun, Apr 10, 2022, 1:23 PM malmiteria <martin.milon@ensc.fr> wrote:
David Mertz, Ph.D. writes:
> Are you likewise "confused" by the fact that `a = b - c` is generally
> different from `a = c - b`?!

Why do you always quote confused?

I'm not, but that's because i've been taught / i've experienced that since primary school. I have been taught math, but not python, nor any programing language.

Most people experience with python will lead them to understand easily that parenthesis are definitely not symetrical, since calling a function is a common thing to do in python, and most programming language.
As much as they would be able to understand that there is many different context in which what's define inside the parenthesis doesn't always mean the same thing. And overall, the "parenthesis operation" doesn't exists as one simple thing.
Sure there's __call__, but parenthesis are also used in method definition, method call and class definition, on top of class calls.
As much as there is some importance of the order of the arguments in method definition, it's definitely a fair assumption, based on generic experiences with the language, that parenthesis in the syntax "class A(B)" simply means something different, and is a different operation.

However, the class definition allows you to refer the class by the name placed before the parenthesis, so it's obvious even only with a generic python experience that the "inside/outside" parenthesis order matter.
Much more than the order within the parenthesis.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/43AEEIGIBPFEPKAIZWPN34PCVGR4QWBD/
Code of Conduct: http://python.org/psf/codeofconduct/