I'm trying to monkey-patch a class instance, but don't quite see how I can patch a class method no problem.
>>> class Simple(object):
... def make(self, arg):
... return arg * 2
...
>>> s = Simple()
>>> def times_four(self, arg):
... return arg * 4
...
>>> Simple.make = times_four
>>> s.make(10)
40
But say I only wanted to replace make
in the instance, what's the easiest way to do that?
>>> def times_eight(self, arg):
... return arg * 8
>>> s.make = ???