On Wed, May 26, 2021 at 1:10 PM Shreyan Avigyan
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 https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/CVMLMQ... Code of Conduct: http://python.org/psf/codeofconduct/