Skip to main content

Questions tagged [inheritance]

For questions about inheritance, a mechanism in object-oriented programming that allows classes to inherit properties and behaviour from other classes, creating a hierarchical relationship between classes.

Filter by
Sorted by
Tagged with
14 votes
10 answers
4k views

Are there any practical use cases for subtyping primitive types?

In, for example, Python, it is possible to subtype primitive types: ...
Wheelwright's user avatar
10 votes
2 answers
127 views

How should I represent objects under prototype-based inheritance?

If I use a class-based system, I know what shape an object will be at the time I construct it, and I know exactly which fields and methods it has. They can be put in fixed locations that remain stable,...
Michael Homer's user avatar
  • 13k
4 votes
1 answer
100 views

How could a language support adding new types to the middle of the inheritance tree in an ABI-stable way?

I've mentioned before that Swift evolution is somewhat limited by the fact that it is now ABI-stable. One recent example that caught my attention was PermutableCollection. Currently, the Collection ...
Bbrk24's user avatar
  • 9,067