Velocity Reviews  Velocity Reviews ( -   Python ( -   -   RE:
Python Global Constant (  Michael Chermside 07-09-2003 12:48 PM
RE: Python Global Constant Krisztian Kepes wrote: > How [do] I
create an global constant in [a] module [that] is > accessable
in from other modules ?  Christoph Becker-Freyseng replies: >
What about using __builtins__ wouldn't make this the constant >
really global?  While adding it to __builtins__ *would* work
like you're thinking, it's not necessary, or appropriate. Python
provides lots of ways for "power users" to "get under the
covers" and change things. This is useful in those situations
where you really need it (some other languages provide NO way to
get at fundamental language features), but such deep black magic
should be reserved for those cases when you really need it.
Modifying __builtins__ definitely falls into such a category: if
you aren't sure whether you need to do it, then you don't. If
you *think* you need to do it, then you shouldn't. If you
understand what's going