Skip to content

Instantly share code, notes, and snippets.

View moonburnt's full-sized avatar
💢
useless useless useless

moonburnt

💢
useless useless useless
View GitHub Profile
@moonburnt
moonburnt / multiple_inheritance_in_python.md
Last active May 1, 2023 00:16
Short introduction guide to multiple inheritance and MRO in python

So, you have a Foo, you have a Bar. Both of them consist of elements that somehow mix together, and you want to make a Baz which inherits from both of them. How would you do that? Well, you'd go for multiple inheritance.

class Foo():
    def get_foo(self):
        return "foo"