
On Fri, 15 Apr 2022 at 20:40, Steven D'Aprano <steve@pearwood.info> wrote:
On Thu, Apr 14, 2022 at 10:46:46AM +1200, Greg Ewing wrote:
On 13/04/22 8:29 am, Steven D'Aprano wrote:
When multiple parent provide candidate to a method resolution, raise an error.
Then you aren't doing full MI any more,
That sounds like a "true Scotsman" argument. Who defines what "full MI" means?
If you look at languages that implement MI, and pick the implementations which allow it with the fewest restrictions, then that is "full MI".
I'm with Greg on this one, for the simple reason that a future language could have fewer restrictions than Python does, and therefore would become the only thing that offers "full MI", displacing other languages. It's a meaningless concept, unless there is some form of absolute completeness that can be attained (and if you go for that, NO language offers "full MI"). My view: If a class inherits two parents, in any meaning of the word "inherits" that follows the normal expectation that a subclass IS an instance of its parent class(es), then it's MI. So if you have "class Foo(Spam, Ham):" and it is reasonable to treat a Foo instance as if it were a Spam instance *and* reasonable to treat a Foo instance as if it were a Ham instance, then it's MI. Erroring out when there is a conflict is a restriction, but I would avoid the term "full MI" because it's more emotive than useful. ChrisA