If it was a language design choice, what is the explanation for it?
Is there any other way around this to avoid someone or even myself changing a constant value while executing a program, without having to use an immutable data type?
If it was a language design choice, what is the explanation for it?
Is there any other way around this to avoid someone or even myself changing a constant value while executing a program, without having to use an immutable data type?
Python tends to favor simplicity, and uses name mangling.
In short, the convention is to use underscores for protected/private variables.
Check this as well :
why python does not have access modifier?And what are there alternatives in python?
Edit1:
If you really want to hide them, you could try this:
#constants.py
foo = 1
Then on your project, use:
import constants
And now you have access to them, and "protected".