in python, is there a way to find the module that contains a variable or other object from the object itself?
Question: As an example, say I have a variable defined where there may be multiple

    
    
    from __ import *
    from ____ import *
    

etc.

Is there a way to figure out where one of the variables in the namespace is
defined?

_edit_

Thanks, but I already understand that import * is often considered poor form.
That wasn't the question though, and in any case I didn't write it. It'd just
be nice to have a way to find where the variable came from.


Answer: This is why it is considered bad form to use `from __ import *` in python in
most cases. Either use `from __ import myFunc` or else `import __ as myLib`.
Then when you need something from `myLib` it doesn't over lap something else.

For help finding things in the current namespace, check out the [pprint
library](http://docs.python.org/library/pprint.html), [the dir
builtin](http://docs.python.org/library/functions.html#dir), [the locals
builtin](http://docs.python.org/library/functions.html#locals), [and the
globals builtin](http://docs.python.org/library/functions.html#globals).

