I am starting out learning Python syntax and in the book that I am reading it is mentioned that objects are assigned by reference and not by value, i.e. foo1=4
Now foo2 and foo1 refer to the same object in memory and I even verified this by using the 'is' keyword that tests for reference equality. Now, if I increment foo1 and check for object equality using 'is' I am getting a 'False' value. Why is that? When I try to print out the value of foo2 it remains unchanged and when I print foo1's value the value has incremented. I did not understand the concept of assigning the objects reference if the value does not update itself in both the variables. Can anyone please explain this observation? Thank you!