Возможно ли в Python получить объект, скажем, Foo, который содержит другой объект, Bar, изнутри Bar сам? Вот пример того, что я имею в виду
class Foo(object):
def __init__(self):
self.bar = Bar()
self.text = "Hello World"
class Bar(object):
def __init__(self):
self.newText = foo.text #This is what I want to do,
#access the properties of the container object
foo = Foo()
Возможно ли это? Спасибо!