I posted my previous idea regarding this on the mailing list. This idea is a 
little different. This idea suggests introducing constant name bindings. This 
is similar to const pointer in C/C++. Once a name has been assigned to a data 
we can change the data (if mutable) but we cannot change the name to point to a 
different data. The only way the data the constant points can get deallocated 
is if it goes out of scope, the program exits or the constant is manually `del` 
by the user. The proposed syntax is as follows,

constant x = 10
constant y = ["List"]
constant z: str = "Hi"

Thanking you,

With Regards
_______________________________________________
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/WEFUZH5P4RI47C44ULCBGM7MUVW5D6GA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to