On 2/26/19 11:36 AM, Maninath sahoo wrote:
is it possible reverse inheritance?
mean child class to parent class


Well, it's Python, so you can do all sorts of things, some of them good ideas, some bad...

Like Alan says, the question as asked doesn't really make a lot of sense to us, but the way classes (really, user-defined types) work does give you a lot of flexibility. Some people feel like we should express it as code reuse at a sophisticated level: if you see a method in another class that you'd like to use for your own class, you can inherit that method by listing the class in your definition. Or, if you don't want to do so, you write your own method. So while I wouldn't call it reverse inheritance, you as author of your class have all the control of what you do and don't take from other classes, and maybe it's not entirely accurate to call them child and parent classes because of that?

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to