{"id":3858,"date":"2022-12-05T06:59:02","date_gmt":"2022-12-05T06:59:02","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=3858"},"modified":"2022-12-05T06:59:03","modified_gmt":"2022-12-05T06:59:03","slug":"hybrid-inheritance-in-python","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/hybrid-inheritance-in-python\/","title":{"rendered":"Hybrid Inheritance in Python"},"content":{"rendered":"<p style=\"text-align: center;\">Hybrid Inheritance in Python<\/p>\n<p>In this type of inheritance, there are different types of inheritance taking place. In such situations, we call it Hybrid Inheritance. Let\u2019s have a quick look at an example, through which, we can understand hybrid inheritance.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3859 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/11\/HYBRID-INHERITANCE-1.jpg\" alt=\"\" width=\"642\" height=\"302\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/11\/HYBRID-INHERITANCE-1.jpg 642w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/11\/HYBRID-INHERITANCE-1-300x141.jpg 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/p>\n<h2 style=\"text-align: center;\">Hybrid Inheritance in Python<\/h2>\n<p>As you can see, in the above example, there are different types of inheritance present in the program. Firstly, the class Child1 and Child2 classes are derived from the Parent class, and then there is another class, which is class Child3, which is derived from the classes Child1 and Parent.\u00a0 So, we can say that there are different inheritances in the program. You can also refer to the given diagram, which demonstrates the hybrid inheritance, as can be seen from the previous example.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3860 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/11\/HYBRID-INHERITANCE-2-1.jpg\" alt=\"\" width=\"259\" height=\"259\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/11\/HYBRID-INHERITANCE-2-1.jpg 259w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/11\/HYBRID-INHERITANCE-2-1-150x150.jpg 150w\" sizes=\"auto, (max-width: 259px) 100vw, 259px\" \/><\/p>\n<p>So, this was about the concept of inheritance. It is very useful at times, and we are going to use it as and when required. You can also solve some more examples related to Inheritance, while we move forward to the next concepts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hybrid Inheritance in Python In this type of inheritance, there are different types of inheritance taking place. In such situations, we call it Hybrid Inheritance. Let\u2019s have a quick look at an example, through which, we can understand hybrid inheritance. Hybrid Inheritance in Python As you can see, in the above example, there are different [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[26,27],"class_list":{"0":"post-3858","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-python-tutorial","7":"tag-python","8":"tag-python-tutorial"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=3858"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3858\/revisions"}],"predecessor-version":[{"id":4234,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3858\/revisions\/4234"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=3858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=3858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=3858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}