In the following I want to talk about Call by Object Reference also known as Call by Sharing. I will use Python to illustrate the concept.
1. Strange behavior?
Let’s have a look at the following Python code:
def changeList1(x): x.append(41) def changeList2(x): x = [41,42]
Save the code in a file callBySharing.py and run it in Read the rest of this entry »