Class1 is instantiated in Class2 as follows. Class2 also contains another 
variable, say:

class Class2: 
    class1 = Class1()
    a = 0

I want to create a method myDef() in Class1 that can read or write to a. How do 
I access a from within myDef() to access a?

Calling Class2.a is not an option as Class1 does not have any knowledge about 
its container class a priori. Also, this will hardcode the path. I want to know 
of a built-in method (kind of equivalent of super() for inheritance) that will 
give me the container class reference, Class2 in this case. 

Thanks. 
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to