alist += [4] and alist = alist + [4] are different as the first changes the reference of alist whereas the latter doesn't. I tried this below on IDLE by using id() and it seems like it is correct claim.
Code executed on IDLE (Python 3.6.1)
>>> alist = [1, 2, 3]
>>> id(alist)
50683952
>>> alist += [4]
>>> id(alist)
50683952
>>> alist = alist + [4]
>>> id(alist)
50533080
Is it possible to get reference to memory address programatically, identify whether the location has a list or a dictionary, read the contents and update the content using reference?
NOTE: I found 2 relevant stackoverflow posts but I am not sure if they answer my question.
解决方案
You are trying to do something like in C, with a Dereference operator, such as * , you can read more about it in this question.
I'm sure that Python has no support for doing what you are trying to achieve, you have to change your mind paradigm, think different to get the results you want.
As you read, you can "get the memory address" from an object, but you want ever find a way (at least in python 2 - 3) to get the way back