Greetings!

How wise is it to base code on inspect? Specifically on things like live frames on the stack and whatnot. It occurs to me that this is leaning towards implementation details, and away from pure, pristine Python.

As an example, I have this routine in a module I'm working on:

def _get_module():
    "get the calling module -- should be the config'ed module"
    target = os.path.splitext(inspect.stack()[2][1])[0]
    target = __import__(target)
    return target

How brittle is this technique?

~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to