Type error in python code
<p>When I try to execute the following:</p>

<pre><code> 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 &lt;: 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 "&gt; PUSH: the pushed state is ", newN.state
                    agenda.push(newN)
    return None
</code></pre>

<p>I get the following error: </p>

<pre><code>TypeError: 'dict' object is not callable
The line where error occured is:
    newS=successor(parent.state, a)
</code></pre>

<p>By the way, successor is even not a dictionary </p>
