+ 1
Class that inherits an object of another class?
Hi! How to create a class that inherits an object from another class instead of a class itself, in Python? And how to make some features of that object shareable between the two (private/public/hidden etc.)? Any good example, please? Thank you so much! P.S. If not possible in Python then any other good way to do it in Python, please?
3 Antworten
+ 3
This is in the python course, (Inheritence), maybe what you are looking for:
https://www.sololearn.com/learn/Python/2469/
+ 2
I know that about inheritance but it is not what i want.
Thank you!
+ 1
You want to create object you want to "inherit" in constructor of that class or some setter method (aka depenedecy injection in some frameworks). Fancy name for this is composition