class treeNode:
def __init__(self,nameValue,numOccur,parentNode):
self.name=nameValue
self.count=numOccur
self.nodeLink=None #用于链接相同元素
self.parent=parentNode
self.children={}
def inc(self,numOccur):
self.count+=numOccur
def disp(self,ind=1):
for child in self.children.values():
print(' '*ind,self.name,' ',self.count)
child.disp(ind+1)
python报错:object() takes no parameters
_init_应该是两个_ , 即__init__