I have a two different classes (A & B for example), and I'm trying to take an instance of class A as a parameter in class B. Edit: I'm trying to create the instance within the constructor of Class B so that I can use it for subsequent methods in Class B.
Basically this:
class A(object):
def __init__(self, various arguments):
self.a_arguments = arguments
class B(object):
def __init__(self, various arguments):
self.b_arguments = arguments
self.a = A(arguments of A)
In this case, how can I list the "arguments of A" when trying to create the instance self.a? When I write the arguments as self.a_arguments, they can't be accessed because they are in Class A and not Class B. When I tried just a_arguments, I get an error that the a_arguments are not defined. Yet I don't want to have to rewrite all the self.a_arguments in the Class B constructor just so I can use them to create an instance of A.