Basically, my question is if I pass an argument to a function in Python, assign some other value to it, and then change that value, will both values change or just one? How exactly are function arguments passed in python?
In other words, say I had some class A defined as follows:
class A(object):
def __init__(self, b):
self._b = b
class B(object):
def increment():
# Do something
...
where class B is some class (exactly what it is doesn't really matter) and both b and _b are of type B. If I did the following:
instanceOfB = B()
instanceOfA = A(instanceOfB)
instanceOfA._b.increment()
would instanceOfB change, or would it remain the same?
I hope this question is clear. I am having a lot of trouble explaining what I want to ask, so feel free to ask for clarification!