[Tutor] Walking up
janos.juhasz@VELUX.com
janos.juhasz@VELUX.com
Tue Nov 26 06:08:03 2002
Hi All,
I have got a simple problem, on getting attributes from the outer domain of
an object.
########
class child:
def __init__(self, text):
self.child_text = text
class parent:
def __init__(self, text):
self.parent_text = text
self.child = child(self.parent_text + ' - child')
myObj = parent('parent')
theChild = myObj.child
## How can i get the 'parent_text' attribute from the 'theChild' object ?
How can i place a function into the child object, that use the variables of
the parent ?
Best Regards,
Janos