Override function at instance level in Python
For package development and temporary testing
from types import MethodType
class Dog:
def bark(self):
print "WOOF"
boby = Dog()
boby.bark() # WOOF
def newBark(self):
print "WoOoOoF!!"
boby.bark = MethodType(newBark, boby)
boby.bark() # WoOoOoF!!
Ref: [StackOverflow]