I\'m having trouble replacing a function from a different module with another function and it\'s driving me crazy.
Let\'s say I have a module bar.py that looks like
There's a really elegant decorator for this: Guido van Rossum: Python-Dev list: Monkeypatching Idioms.
There's also the dectools package, which I saw an PyCon 2010, which may be able to be used in this context too, but that might actually go the other way (monkeypatching at the method declarative level... where you're not)