On Thu, Jan 12, 2012 at 1:02 PM, Thomas E Jenkins <[address removed]>
Something based on the above might be more what you are looking for, but just to give another option.
You can leave the hairy function in a module with it referencing all of the module-level (global) vars and just import that module as a variable and manipulate those module level vars to override them.
So if you have a hairy.py with:
return frob + other
You can then do the below:
>>> hairy_mod = __import__('hairy')
>>> hairy_mod.frob = 88
This might actually allow me to use the original code without changing it at all. Thanks Thomas!