Re: Introduce constants in Python (constant name binding)
oops, forgot to include the list.
i really hate lists that don't have the the list as the default reply
setting :-(
(Yes, I know that goes against the conventional wisdom)
On Wed, May 26, 2021 at 9:14 AM Shreyan Avigyan
wrote:
Well. How can I go beyond why constant was invented in the first place?
But constant was invented for other, far more static languages. And many in this thread have said that even then it often needs to be worked around.
The main reason constant was invented was to provide an additional
support to programmers so that they don't make a program unstable.
The same could be said for static typing.
And Python’s solution to that is type annotations and type checkers. Which supports Final.
In short, yes, the concept of constant is useful, but it is not a good fit for Python.
However:
When you spoke of “like a literal” that brought to mind something else: a C preprocccesor like pre-complier time substitution. Which might have some use, but it would only work within a single module, so not very useful.
-CHB
-- Christopher Barker, PhD (Chris)
Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
-- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
Christopher Barker writes:
i really hate lists that don't have the the list as the default reply setting :-(
This is something that lists should *not* do, because your MUA can and should do it for you (and not for me). If you want the feature, get a decent MUA (unfortunately, that probably means using an Emacs-based MUA or Mutt). The algorithm the MUA needs to implement is not difficult (basically, look for a List-Post field in the header and reply-to-list if found), nor is any additional needed functionality (and many MUAs already implement reply-to-list). For reasons I don't understand, the popular MUAs just refuse to DWIM the 'r' key for you.
participants (2)
-
Christopher Barker
-
Stephen J. Turnbull