Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #78500
| References | (3 earlier) <a140612a-a30d-43eb-93a3-bc08b76b5721@googlegroups.com> <mailman.14489.1412095890.18130.python-list@python.org> <2ea96bcf-e905-4d77-a105-82b27715aa6e@googlegroups.com> <mailman.14490.1412097338.18130.python-list@python.org> <ed01079d-5103-4136-b4c6-a2e060916e02@googlegroups.com> |
|---|---|
| Date | 2014-10-01 03:46 +1000 |
| Subject | Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.14492.1412099193.18130.python-list@python.org> (permalink) |
On Wed, Oct 1, 2014 at 3:31 AM, Rustom Mody <rustompmody@gmail.com> wrote:
> On the other hand if you impose a convention: Constants file-module has
> NOTHING but constants, thats a non-formal convention and thats ok.
>
> If however you mix it up with other (real) code, you'll get a bloody mess.
> This kind of stuff "7*24*60*60" is borderline and in my experience
> its a slippery slope that ends up being more trouble than its worth.
Agreed, and which side of the border it's on is a matter of opinion.
Suppose you were writing an INI-style parser - would you include this
feature? I probably wouldn't include arithmetic, as it's usually more
effort than it's worth, but it isn't a bad feature inherently. I'd
definitely not include backreferencing (FOO = "bar", followed by
FOO_LEN = len(FOO) or something), or the ability to chain assignments
(FOO = BAR = 0), so those would be advised against in the convention
docs. On the other hand, a quoted string requirement ("foo\nbar")
makes a huge amount of sense in certain contexts, and I can imagine
implementing quite a lot of a programming language's string literal
syntax.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Keepin constants, configuration values, etc. in Python - dedicated module or what? cl@isbd.net - 2014-09-30 12:35 +0100
Re:Keepin constants, configuration values, etc. in Python - dedicated module or what? Dave Angel <davea@davea.name> - 2014-09-30 09:14 -0400
Re: Re:Keepin constants, configuration values, etc. in Python - dedicated module or what? cl@isbd.net - 2014-09-30 15:55 +0100
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Dave Angel <d@davea.name> - 2014-10-02 14:50 -0400
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Rustom Mody <rustompmody@gmail.com> - 2014-09-30 06:15 -0700
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? cl@isbd.net - 2014-09-30 16:06 +0100
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? jkn <jkn_gg@nicorp.f9.co.uk> - 2014-09-30 08:59 -0700
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Rustom Mody <rustompmody@gmail.com> - 2014-09-30 09:39 -0700
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Chris Angelico <rosuav@gmail.com> - 2014-10-01 02:51 +1000
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Rustom Mody <rustompmody@gmail.com> - 2014-09-30 10:01 -0700
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Chris Angelico <rosuav@gmail.com> - 2014-10-01 03:15 +1000
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Rustom Mody <rustompmody@gmail.com> - 2014-09-30 10:31 -0700
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Chris Angelico <rosuav@gmail.com> - 2014-10-01 03:46 +1000
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-02 00:49 +1000
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Chris Angelico <rosuav@gmail.com> - 2014-10-02 00:55 +1000
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? cl@isbd.net - 2014-09-30 18:30 +0100
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Chris Angelico <rosuav@gmail.com> - 2014-10-01 03:49 +1000
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? Rustom Mody <rustompmody@gmail.com> - 2014-10-16 18:24 -0700
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? "Neil D. Cerutti" <neilc@norwich.edu> - 2014-09-30 12:16 -0400
Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? cl@isbd.net - 2014-09-30 18:50 +0100
csiph-web