In the following code, I pass a reference to a class variable, using its class name, to a method in another class, expecting it to modify it, but it doesn't. As I understand it, Python always passes parameters by reference, never by value, so I would expect the class variable value to have changed. Why not?
Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 12:45:02) [MSC v.1900 32 bit (Intel)] on win32
>>> class Other:
... def modify(self, another_class_member):
... another_class_member += 1
...
>>> class Mine:
... cls_incrementer = 0
... def __init__(self):
... self.my_other = Other()
...
>>> mine = Mine()
>>> mine.cls_incrementer
0
>>> mine.my_other.modify(Mine.cls_incrementer)
>>> Mine.cls_incrementer
0
>>> mine.cls_incrementer
0