5 ms·
This is the kind of ad-hoc PEP proposal that could be completely avoidable if there was a generic modifier or initialization/declaration construction for declar
by snrji 7y ago
This is the kind of ad-hoc PEP proposal that could be completely avoidable if there was a generic modifier or initialization/declaration construction for declaring a variable as constant. So incredibly simple, so incredibly useful that it's hard to believe that it hasn't been accepted yet (it was proposed).
- laurencerowe 7y agoA const declaration only ensures that the variable always points to the same object, not that that object is immutable. For instance in JS: const foo = {}; foo.bar = 1;
- snrji 7y agoThat depends on the language.