Im trying to call a grandfather method and getting the following error (RecursionError):
class GrandParent:
def get_data(self):
return 5
class Parent(GrandParent):
def get_data(self):
return super(self.__class__, self).get_data()
class Child(Parent):
def get_other_data(self):
d = self.get_data()
print(d)
return d
demo = Child()
res = demo.get_other_data()
print('done')
And i'm getting the following error:
RecursionError: maximum recursion depth exceeded while calling a Python object
Why is that?
I tried to look at this one: RecursionError: maximum recursion depth exceeded while calling a Python object(Algorithmic Change Required) but it seems like we shouldn't have any recursion issues.
Thanks in advance!!!