Created
January 25, 2013 03:11
-
-
Save cesarkawakami/4631433 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeMixin(object): | |
def __init__(self, home, *args, **kwargs): | |
super(HomeMixin, self).__init__(*args, **kwargs) | |
self.home = home | |
class PenMixin(object): | |
def __init__(self, pen, *args, **kwargs): | |
super(PenMixin, self).__init__(*args, **kwargs) | |
self.pen = pen | |
class PenAndHome(PenMixin, HomeMixin): | |
pass | |
inst = PenAndHome("pen", "home") | |
print inst.pen # prints pen | |
print inst.home # prints home |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment