[Python-ideas] Should Python have user-defined constants?

Ivan Levkivskyi levkivskyi at gmail.com
Tue Nov 21 06:17:38 EST 2017


On 21 November 2017 at 12:12, Stéfane Fermigier <sf at fermigier.com> wrote:

> That's one way to do it with no changes to the language, though
> syntaxically I find it lacking a bit of elegance (maybe a matter of getting
> accustomed with it?).
>
> Also, I'm not sure "Final" really conveys what it means (at first glance,
> I thought it was about immutability, not constantness).
>
> Maybe "Const" would be better in this context ? (Or maybe you've discussed
> this question already and come to the conclusion that "Final" is better for
> some reason?)
>

It is not set in stone, but it looks like most people like Final (although
the initial proposal was Const, see
https://github.com/python/mypy/issues/1214)

--
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171121/cd90a7a5/attachment.html>


More information about the Python-ideas mailing list