Greg Ewing writes:

> That sounds like a "true Scotsman" argument. Who defines what
> "full MI" means?
+1

for the record, i consider it multiple inheritance as soon as one class can 
inherit from multiple parents, no matter anything else.

> I can think of at least two languages that do something very
> similar to what malmalitia is proposing
malmiteria xD not malmalitia


---
David Mertz, Ph.D. writes:
> I also co-authored a widely read article on then-new C3 linearization in
> Python with Michele Simianato before he wrote his really great explanation
> of it in the Python docs, and his also great 15+ year old pieces on traits
you mean this one? : https://www.python.org/download/releases/2.3/mro/


---
Steven d'Aprano writes: 
> Its not impossible, I have been telling you about traits since my 
> earliest posts in this thread.
And traits aren't what i want. My proposal is very different from what i 
understand of trait so far. Although it's still new to me, so if you feel i'm 
missing something, feel free to explain it to me.

> > Linearisation is litterally an operation that consist into converting 
> > a multiple inheritance tree into a simple inheritance tree.
> 
> That is absolutely not what linearization does.

That's very much what it does, implicitely tho.

Take the mro from any class.
create a copy of the first class, and assign it only one parent.
This parent is the copy of the next in mro order, which too takes only one 
parent.
until we reach the last one in mro order, which is object.

This 100% simple inheritance tree behave as far as i can tell 100% like the 
original class. No matter if the original class was multiple inheritance or not.
Resolution order is the exact same, super visiting order is the exact same... 
class.method calls are independant, so they wouldn't change either.

this can't be done for every class very nicely, as editing __bases__ attribute 
sometime is not permitted.
so you'll excuse me for not providing a nice bit of code that does the 
convertion in the inheritance tree for you.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@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/DZR7JHODTRAYYTWP6YH7E24ITC2ZEG36/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to