Use mixin instead of inheritance to add shared functionality without changing the primary structure of a class.
In the example above, the inheritance-based approach assumes that the PickleableModel class has a .model attribute that needs to be serialized. This assumption may not be true for all subclasses.
The PickleableMixin can be applied to any class that needs serialization, not just machine learning models.