Skip to content
Vinicius Reif Biavatti edited this page Jul 25, 2022 · 2 revisions
  • Use the Suffix Mixin to determinate that the class is a mixin
  • The Child class should inherit mixins as first, and then the other base classes

✅ Do

# Mixin suffix
class JSONMixin():
    ...

# Mixin as first base
class Child(JSONMixin, BaseClass):
    ...

❌ Don't

# Without mixin suffix
class JSON():
    ...

# Mixin as second base (wrong)
class Child(BaseClass, JSONMixin):
    ...
Clone this wiki locally