On Wed, May 26, 2021 at 1:10 PM Shreyan Avigyan <pythonshreyan09@gmail.com> wrote:
Reply to Paul Moore:

In Python terms, a constant is a name that binds itself to a value in memory and that name cannot bind itself to a different value now (unlike variables). The value can be mutated (if mutable) but the name cannot bind to a different value once it has bind itself to a value.

Given Python already has a method for annotating a variable (name binding) as 'constant', by using typing.Final,  I don't see any need for an alternative syntax for this.

Wouldn't it be simpler to just propose making the compiler/runtime enforce typing.Final annotations at compile and/or run-time?

PEP 591 has all of the definitions and explanation pre-written for you, so that would avoid all the terminology wrangling too ;)

Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/CVMLMQIQMKPKNGF2LKRYGRW4UO2CL2X4/
Code of Conduct: http://python.org/psf/codeofconduct/