In <579a15bf-83c0-4228-9079-bbaac1222...@o13g2000vbl.googlegroups.com> Marius
Gedminas writes:
>On Sep 4, 9:29=A0pm, kj wrote:
>> The only solution I can come up with is to define a "dummy module",
>> say _config.py, which contains only upper-case variables representing
>> these global switches
On Sep 4, 9:29 pm, kj wrote:
> The only solution I can come up with is to define a "dummy module",
> say _config.py, which contains only upper-case variables representing
> these global switches, and is imported by all the other modules in
> the application with the line "from _config import *".
kj wrote:
> I'm looking for the "best-practice" way to define application-global
> read-only switches, settable from the command line. The best
> example I can think of of such global switch is the built-in variable
> __debug__. This variable is visible everywhere in a program, and
> broadl
In Ethan Furman
writes:
>I've seen a couple cool recipes implementing WORM* attributes if you
>wanted to ensure that your settings were not re-set.
>Steven D'Aprano wrote one with a class name of ConstantNamespace, you
>can search on that if you're interested. I'd include the code, but I
but I wonder if there is a more Pythonic
way to do this sort of thing. Is there a best practice for setting
such application-global switches?
TIA!
kynn
I've seen a couple cool recipes implementing WORM* attributes if you
wanted to ensure that your settings were not re-set.
Steven D'
7;m sure this would work OK, but I wonder if there is a more Pythonic
way to do this sort of thing. Is there a best practice for setting
such application-global switches?
TIA!
kynn
while 1:
try:
run_main_code()
cleanup()
except:
while conn_fail():
time.sleep(5.0)
fina
d-only, since they
> most be set at the beginning of the run. But after this initial
> setting, they should remain read-only.)
>
> I'm sure this would work OK, but I wonder if there is a more Pythonic
> way to do this sort of thing. Is there a best practice for setting
but I wonder if there is a more Pythonic
way to do this sort of thing. Is there a best practice for setting
such application-global switches?
I believe what you describe above is more or less standard practice.
--
http://mail.python.org/mailman/listinfo/python-list
f there is a more Pythonic
way to do this sort of thing. Is there a best practice for setting
such application-global switches?
TIA!
kynn
--
http://mail.python.org/mailman/listinfo/python-list