Last active
March 26, 2017 16:56
-
-
Save pcote/f4b2fb4eba25743c0d92f2fbf02009c4 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)) | |
def say_other_stuff(self): | |
print("New say_stuff says this: {}\n\n".format(self.msg)) | |
MyClass.say_stuff = say_other_stuff | |
ob = MyClass("This is my message here") | |
ob.say_stuff() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment