logoalt Hacker News

rhdunnlast Wednesday at 8:22 AM2 repliesview on HN

There are two types of inheritance:

- interface/API based -- this is supported in modern languages via interfaces, traits, etc.

- implementation/code based -- modern languages tend to only support single inheritance; they tend to also support default method implementations on the interfaces/traits


Replies

bheadmasterlast Wednesday at 10:15 AM

> interfaces, traits, etc.

Those are actually mechanisms for achieving polymorphism.

Inheritence inherently (heh) consists of "inheriting" parent class' internals and having ability to extend them. It is basically composition, polymorphism and monkeypatching in a trench coat.

goatloverlast Wednesday at 8:27 AM

It's interesting that Python does support multiple inheritance.