Jack Diederich wrote:
You want to import a name that is itself a namespace; preferably a
module or package and sometimes a class. Importing constants can lead
to trouble. ex/
from settings import DEBUG
if DEBUG: log('debug is on!')
The value of the flag gets fetched at import time. If code in another
module updates settings.DEBUG later your module won't see it. ditto
for exceptions.
-Jack
The idea behind constants is that they are... um... constant. ;) I
imagine exceptions don't get changed often either. (At least, I never
change mine.)
If you have a setting that may change, don't call it a constant and name
it accordingly.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list