Type error in python code
When I try to execute the following:


     def breadthFirstSearch(initialState, goalTest, actions, successor):
        agenda = Queue()
        if goalTest(initialState):
            return [(None, initialState)]
        agenda.push(SearchNode(None, initialState, None,2))
        while not agenda.empty():
            parent=agenda.pop()
            print "POP <: the popped state is ", parent.state
            for a in actions:
                newS=successor(parent.state, a)
                if newS != None:
                    newN=SearchNode(a, newS, parent)
                    if goalTest(newS):
                        return newN.path()
                    else:
                        print "> PUSH: the pushed state is ", newN.state
                        agenda.push(newN)
        return None

I get the following error: 

>TypeError: 'dict' object is not callable
The line where error occured is:

>            newS=successor(parent.state, a)
By the way, successor is even not a dictionary 
Type error in python code
===

When I try to execute the following:


     def breadthFirstSearch(initialState, goalTest, actions, successor):
        agenda = Queue()
        if goalTest(initialState):
            return [(None, initialState)]
        agenda.push(SearchNode(None, initialState, None,2))
        while not agenda.empty():
            parent=agenda.pop()
            print "POP <: the popped state is ", parent.state
            for a in actions:
                newS=successor(parent.state, a)
                if newS != None:
                    newN=SearchNode(a, newS, parent)
                    if goalTest(newS):
                        return newN.path()
                    else:
                        print "> PUSH: the pushed state is ", newN.state
                        agenda.push(newN)
        return None

I get the following error: 

>TypeError: 'dict' object is not callable
The line where error occured is:

>            newS=successor(parent.state, a)
By the way, successor is even not a dictionary 