8 ms·
>Python's OO does support features like multiple inheritance, which makes it more sophisticated than e.g. Java. I’m not sure that “more sophisticated” is the r
by dhosek 4y ago
>Python's OO does support features like multiple inheritance, which makes it more sophisticated than e.g. Java.
I’m not sure that “more sophisticated” is the right term for multiple inheritance. Multiple inheritance create all manner of challenges in understanding code. The simplest form of multiple inheritance as it’s present in languages like Perl or C++ can create hard to debug problems (I’m not entirely certain how it works in Python).
That said, Java has (and has had) a restricted form of multiple inheritance for years through default methods in interfaces which allows the most useful aspect of MI—mixed in methods.
- p_l 4y agoCLOS implementation of multiple inheritance is less problematic, and usually you don't have overlapping methods involved - and if you really need to, you have interfaces to control inheritance process (including the ability to prevent multiple inheritance)