Any way to set or overwrite the __line__ and __file__ metadata?
- by charles.merriam
I'm writing some code that needs to change function signatures. Right now, I'm using Simionato's FunctionMaker class, which uses the (hacky) inspect module, and does a compile. Unfortunately, this still loses the line and file metadata.
Does anyone know:
If it is possible to overwrite these values in some odd way?
If hacking up a class with a complex getattribute() to intercept the values and also try to make the class looks like a function is any more possible than a moose with a flying nun hat?
Is there an alternative to the (hacky) inspect module? PEP 362 is dead dead dead?
I know decorators and cPickle users fight with this. What other situations is the read only metadata in people's way?
I appreciate any insights. Thank you.