[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Lib/test test___all__.py,NONE,1.1

Moshe Zadka moshez@zadka.site.co.il
Sun, 21 Jan 2001 14:37:57 +0200 (IST)


Yay! I can change to python-dev manually!
(hear sounds of the timbot's teeth grinding)

On Sat, 20 Jan 2001, Skip Montanaro <montanaro@users.sourceforge.net> wrote:
> def check_all(_modname):
>     exec "import %s" % _modname
>     verify(hasattr(sys.modules[_modname],"__all__"),
>            "%s has no __all__ attribute" % _modname)
>     exec "del %s" % _modname
>     exec "from %s import *" % _modname
>     
>     _keys = locals().keys()
....

Wouldn't it be better to use the

d = {}
exec "foo", d

And verify "d" instead?

-- 
Moshe Zadka <sig@zadka.site.co.il>
This is a signature anti-virus. 
Please stop the spread of signature viruses!
Fingerprint: 4BD1 7705 EEC0 260A 7F21  4817 C7FC A636 46D0 1BD6