Module mixins allow you to inherit from modules. This is how ruby achieves multiple inheritance, and I just wanted to show it's possible in python as well.
Python, 2 lines
def mixin(mod): return type("mixin(%s)" % (mod.__name__,), (object,), mod.__dict__)
see http://sebulba.wikispaces.com/recipe+module+mixins for more info and examples.
Cool. What about accessing 'self'?
Okay, saw it in the wiki page.
Maybe the mixin function can do the include too, so this:
Can be replaced with this: