I'm quite the newbie regarding Python, and I got this code from someone else. Now I'm trying to figure out if these are good Python programming practices or just a redundant definition somehow.
I got this Controller class, which is related to some other classes, and, within the definitions I see that the Robot Class object is passed to a Data Class object, and it is directly assigned to a member of the Data Class object.
class RobotClass():
def __init__(self):
self.addresses = [0x03,
0x04,
...
class Data():
def __init__(self, robot, ui):
self.robot = robot
...
class Controller():
def __init__(self):
self.robot = RobotClass()
self.ui = UI()
self.data = Data(self.robot, self.ui)
...
controller = Controller()
My question is: are both variables (Robot Class object and Data Class member) the same? Will any change in the one reflect in the other? Or they are different from the instant of the assignment?