Ah, but Tim! You've forgotten to take advantage of one of our
new (v1.0.2) features! Who needs eval when you have vars?
>>> import __main__
>>> module_type = type(__main__)
>>> v = vars(__main__)
>>> for n in v.keys():
... if type(v[n]) is module_type:
... print n+':', dir(v[n])
...
__main__: ['__main__', '__name__', 'module_type', 'n', 'v']
and the second (anything with a '__dict__') example would be:
>>> for n in v.keys():
... if hasattr(v[n], '__dict__'):
... print n+':', dir(v[n])
...
__main__: ['__main__', '__name__', 'module_type', 'n', 'v']
-------> Tommy.
"Subvert the parental paradigm - Refuse Birth."