[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Lib sre_constants.py (etc)
Skip Montanaro
skip@mojam.com (Skip Montanaro)
Thu, 15 Feb 2001 17:13:09 -0600 (CST)
Fredrik> can anyone explain why it's a good idea to have totally
Fredrik> incomprehensible stuff like
Fredrik> __all__ = locals().keys()
Fredrik> for _i in range(len(__all__)-1,-1,-1):
Fredrik> if __all__[_i][0] == "_":
Fredrik> del __all__[_i]
Fredrik> del _i
Fredrik> in my code?
Please don't shoot the messenger... ;-)
In modules that looked to me to contain nothing by constants, I used the
above technique to simply load all the modules symbols into __all__, then
delete any that began with an underscore. If there is no reason to have an
__all__ list for such modules, feel free to remove the code, just remember
to also delete the check_all() call in Lib/test/test___all__.py.
Skip