News for hackers. Stuff that matters.
Re:Python proposal: add immutable (persistent) dictionaries by snrji on Thursday September 19, 2019 @02:30PM (#21019092)
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).
Re:Python proposal: add immutable (persistent) dictionaries by laurencerowe on Thursday September 19, 2019 @04:54PM (#21020657)
A 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;

Re:Python proposal: add immutable (persistent) dictionaries by snrji on Saturday September 21, 2019 @04:03PM (#21037592)
That depends on the language.
Re:Python proposal: add immutable (persistent) dictionaries by yen223 on Thursday September 19, 2019 @05:24PM (#21020900)
Something interesting to note is that Python’s ContextVar (introduced in Python 3.7) is a persistent dictionary.

https://www.python.org/dev/peps/pep-0567/#implementation

Re:Python proposal: add immutable (persistent) dictionaries by lolc on Thursday September 19, 2019 @05:31PM (#21020949)
Nice I like having persistent structures available. Then I don't have to safeguared against unintended modifications.