Consider using the inspect module which has functions like getmodule which might be what are looking for:
>>>import inspect >>>import xml.etree.ElementTree >>>et = xml.etree.ElementTree.ElementTree() >>>inspect.getmodule(xmlet) <module 'xml''xml.etree.ElementTree' from 'D:\tools\python2.5.2\lib\xml\__init__2\lib\xml\etree\ElementTree.pyc'>