I have two classes. I later create instances. One class creates an instance of the other class within itself. My question, is how does the child access the parent's properties, since it doesn't know ahead of time that it's going to be "adopted"? Example:

class Boo:
    pass

class Foo:
    X = 1
    __init__(self):
        self.test = boo()


How in this case does the boo instance (self.test) access variable X? I need to write a function in the Boo class that assume the Boo instance is going to be instantiated within another class instance which will have certain variables it needs to access. How do I do this? Am I making sense?

Thank you to anyone who can help.

- Cloudthunder
      
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to