From my understanding, the function super
should allow a Class that is nested within another to access its parent's 'self'. I may be wrong on this, but here is a simple example of what I'm trying to achieve:
class Test:
def __init__(self):
self.message = "Hello World"
class Print:
def __init__(self):
print super(Test, self).message
this = Test()
this.Print()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home1/users/joe.borg/<ipython-input-3-3eb5db70be43> in <module>()
----> 1 this.Print()
/home1/users/joe.borg/<ipython-input-1-cee67a2914c3> in __init__(self)
4 class Print:
5 def __init__(self):
----> 6 print super(Test, self).message
7
TypeError: must be type, not classobj