Submitted by mambenanje (not verified) on Mon, 18/06/2007 - 22:13.
well I think there is some mix up here, object references are values, that is the variables are like normal primitive types so when u pass the reference in a function the reference is passed by value, but remember its pointing to an object. so if you assign the pointer(reference variable) that was passed by value to another object it simple cuts the link to the original object that it pointed to. So when u leave that function and get to the parent scope the old pointer is still pointing to the original object and when u display it, it gives the original but if you use the pointer and call the pointed objects method, it will modify it, so I believe python like java the objects are still passed by reference and the reference are actually passed by value. dont get it mixed up, correct me if I am wrong
pass by reference pass by value
well I think there is some mix up here, object references are values, that is the variables are like normal primitive types so when u pass the reference in a function the reference is passed by value, but remember its pointing to an object. so if you assign the pointer(reference variable) that was passed by value to another object it simple cuts the link to the original object that it pointed to. So when u leave that function and get to the parent scope the old pointer is still pointing to the original object and when u display it, it gives the original but if you use the pointer and call the pointed objects method, it will modify it, so I believe python like java the objects are still passed by reference and the reference are actually passed by value. dont get it mixed up, correct me if I am wrong