Popular recipes tagged "mixins" but not "inheritance"http://code.activestate.com/recipes/tags/mixins-inheritance/2011-08-12T15:29:21-07:00ActiveState Code RecipesMixins by Inheritance vs. by Decorator...Let's Try Decorators (Python)
2011-08-12T15:29:21-07:00Eric Snowhttp://code.activestate.com/recipes/users/4177816/http://code.activestate.com/recipes/577824-mixins-by-inheritance-vs-by-decoratorlets-try-deco/
<p style="color: grey">
Python
recipe 577824
by <a href="/recipes/users/4177816/">Eric Snow</a>
(<a href="/recipes/tags/decorators/">decorators</a>, <a href="/recipes/tags/mixins/">mixins</a>).
</p>
<p>Using mixin classes via inheritance has its pros and cons. Here is an easy alternative via a decorator. As a bonus, you can mix in attributes from any object, not just classes.</p>