Consider the following code snippet:
dict [name] = 0
dict [name] += 1
dict [name] += 1
Does the python interpreter automatically recognise the repeated references to the dictionary value and use a cached local reference instead?, somewhat akin to the aliasing optimisations of C/C++, becoming something like so:
value = dict [name]
value = 0
value += 1
value += 1
Obviously, it's not a big deal to do this manually but I'm curious if it's actually necessary. any insight, feedback, etc is appreciated.