Pyenos wrote: > Approach 1: > > class Class1: > class Class2: > def __init__(self):self.variable="variable" > > class Class3: > def method():print Class1().Class2().variable #problem > > Approach 1.1: > > class Class1: > class Class2: > def __init__(self):self.variable="variable" > > class Class3: > def method():print Class1.Class2.variable #problem
> Approach 2: > > class Class1: > class Class2: > variable="variable" > > class Class3: > def method():print Class1().Class2().variable #problem > Approach 2.1: > > class Class1: > class Class2: > variable="variable" > > class Class3: > def method():print Class1.Class2.variable #problem > > Is there a correct solution in the above? Or, what is the solution? Your definition of Class3.method() shall have a 'self' argument, then the above will all be ok. -- http://mail.python.org/mailman/listinfo/python-list