Ron Adam wrote: > Do you have any feature suggestions, additional information that could > go in, something that would extend the content in some way and make it > more useful? > > As it stands now, it could be just a module, so you could... > The style is still a sticking point for me -- too many evals (a nasty lure for evil-doers).
Recall that sys.modules is a dictionary from module names to modules. Any python object (including a module) will return attributes listed in a dir(obj) with getattr(obj, attributename). So, no evals are needed in this program at all. I also wonder if you've ever used maxlevel>1. It seems you'd expand to way too many names to be useful. Finally, if you use StringIO (or cStringIO), most of your string construction can be turned into prints in a way similar to: def printnames(namelist, dest=None): for name in sorted(namelist, key=str.lower): print >>dest, name from cStringIO import StringIO def textnames(namelist): hold = StringIO() printnames(namelist, hold) return hold.getvalue() --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list