David, when you exaggerate the strength of your argument, you make all
of us look bad. Like this:
> Can you think of ANY context in Python in which the order of items in
> parentheses isn't important?!
Sure: operator.add(1, 2) == operator.add(2, 1)
For that matter, there are plenty of mixins where
class C(A, B)
class C(B, A)
*are* equivalent. It is just that in general they aren't.
We had a reasonable argument, that in general the order of arguments
matter. But by asking for *even one single counter-example*, or in your
words "ANY", you undercut that message.
In any case, I think this discussion about the order of declaration for
superclasses is a distraction. How else are we going to declare
superclasses except in a sequence, left to right?
And the order of inheritance does matter in general. It makes a
difference whether you call the superclass methods in this order:
A.method() # copy data from temporary files to the database
B.method() # delete temporary files
or in this order:
B.method() # delete temporary files
A.method() # copy data from temporary files to the database
So in the general case, order matters. We have to linearize the
superclasses, and call them in that linear order, and the best way to do
that is with the MRO and super.
--
Steve
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/KMVPCXT34UZLTR3M7BRLIQEHWKREA3DO/
Code of Conduct: http://python.org/psf/codeofconduct/