Last active
March 26, 2017 16:58
-
-
Save pcote/27cf6dd537c77e0e08202c4100960ac5 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 MyClass(object): | |
def __init__(self, msg): | |
self.msg = msg | |
def say_stuff(self): | |
print("Standard say stuff message: {}\n\n".format(self.msg)) | |
ob = MyClass("Here is the original message") | |
def say_stuff(): | |
m = "Thought I'd say something else, didn't you?" | |
print(m) | |
#setattr(ob, "say_stuff", say_stuff) | |
ob.__dict__["say_stuff"] = say_stuff | |
ob.say_stuff() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment