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, <arj.pyt...@gmail.com>
wrote:

> 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-le...@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/S2CTGF562UST4DM22HO7SLZ3EEWG544G/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@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/7FK56ZRCC3XP3CIN7DEF3OD3ELUFYGIY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to