This is already available with typing.Final and immutable types:
from typing import Final
ham: Final = 3
ham = 4 # Error
hams: Final[Sequence[str]] = ["ham", "spam"]
hams.append("meat") # Error
On Mon, 24 May 2021, 18:40 Abdur-Rahmaan Janhangeer,
Greetings,
Just a light-hearted note, if ever the idea is taken seriously,
variable: constant = 10
seems more pythonic to me.
constant variable = 10 opens the doors for
int x = 5 etc
Kind Regards,
Abdur-Rahmaan Janhangeer about https://compileralchemy.github.io/ | blog https://www.pythonkitchen.com github https://github.com/Abdur-RahmaanJ Mauritius _______________________________________________ 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/S2CTGF... Code of Conduct: http://python.org/psf/codeofconduct/