Created
August 8, 2015 12:43
-
-
Save rbrady/f9d1dcbcec18a57ce2cf to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
class Foo(object): | |
def __init__(self, name): | |
self.name = name | |
def get_name(self): | |
return self.name | |
class MasterBuilderNameMixin(object): | |
def get_name(self): | |
return "%s, Master Builder" % self.name | |
if __name__=="__main__": | |
foo = Foo("Emmett") | |
print(foo.get_name()) | |
foo.__class__ = type('MasterBuilderFoo', | |
(MasterBuilderNameMixin, Foo), {}) | |
print(foo.get_name()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment