I have the following structure:
class foo(object):
class bar(object):
def __init__(self, parent):
self._parent=parent #this
def worker(self):
return self._parent.name
def __init__(self, name):
self.name=name
def giveNamePointer(self):
return self.bar(self) #and this
Which works fine, however I was wondering if there is an implicit or easier way to get the reference to the creating instance in the special case, that the created instance is a class defined in the creating class.
edit: could this help me :implementing descriptiors and if so how?