i made a class in c++ and it had a member of the same class and it gave a incomplete type class error.
class A{
private:
A member;
};
i found these "Incomplete type" in class which has a member of the same type of the class itself ,Incomplete Type these gave a very good explanation as to why the error happened and how to fix it.
but for practice i made the same code on python 2.7 and it was able to make a class with a member of the same class.
my question is HOW(whats the explanation) python is able to do that, and possible difference between c++ and python on handling this particular problem
python code:
class node:
def __init__(self,t):
self.key=t
self.lc=None
self.rc=None
parent=node(10)
lc=node(5)
rc=node(15)
parent.lc=lc
parent.rc=rc