S
Steve
Hi,
I have a nested class declaration such as:
class A:
def __init__(self):
self.var = "A's variable"
# end def
class B:
def __init__(self):
self.var2 = "B's variable"
# end def
# end class B
# end class A
What I want to do is to be able to get class A's 'var' variable from the
nested class B. For example, I want to be able to do something like:
print "I can see you %s" % a.var
but... I don't want to make 'var' a class variable. I want it to be an
instance variable but still be viewable by the inner class B. Is this
possible? Any suggestions? Thanks
Steve
I have a nested class declaration such as:
class A:
def __init__(self):
self.var = "A's variable"
# end def
class B:
def __init__(self):
self.var2 = "B's variable"
# end def
# end class B
# end class A
What I want to do is to be able to get class A's 'var' variable from the
nested class B. For example, I want to be able to do something like:
print "I can see you %s" % a.var
but... I don't want to make 'var' a class variable. I want it to be an
instance variable but still be viewable by the inner class B. Is this
possible? Any suggestions? Thanks
Steve