Why does the 22 line not work
from Queue import priorityQueue class state(object): def __init__(self,value,parent, start = 0, goal = 0, solover = 0): self.children = [] self.parent = parent self.value = value self.dist = 0 if parent: self.path = parent.path[:] self.path.append(value) self.start = parent.start self.goal = parent.goal self.solver = parent.solver else: self.path = [value] self.start = start self.goal = goal self.solver = solver def GetDist(self): pass def creatchildren(self): pass class State_String(State): def__init__(self, value, parent, start == 0, goal == 0): super(State_String, self).__init__(value, parent, start, goal) self.dist = self.GetDist() def GetDist(self): if self.value == self.goal: return 0 dist = 0 for i in range(len(self.goal)): letter = self.goal[i] dist += abs(i - self.value.index(letter)) return dist def CreateChildren(self): if not self.childern for i in xrange(len(self.goal)-1): val = self.value val = val[:i] + val[i+1] + val[i] + val child = State.String(val, self) self.children.append(child)