title: Use of update() for an instantiated object
body: <p>I apologize in advance if I'm asking a somewhat obvious question, but I'm somewhat new to Python and am still figuring out the kinks of it.</p>
  
  <p>I'm working on a script to search through a tree, starting at node A and (hopefully) terminating at goal node M. My work is based off of the example code provided in <em>Artificial Intelligence: A Modern Approach</em>, <a href="http://aima-python.googlecode.com/svn/trunk/search.py" rel="nofollow">specifically this Python search script</a>.</p>
  
  <p>I run into difficulties when attempting to execute a breadth_first_search, where I get the following error:</p>
  
  <pre><code>...
  update(self, state=state, parent=parent, action=action, 
          path_cost=path_cost, depth=0)
  NameError: global name 'update' is not defined
  </code></pre>
  
  <p>I am attempting to use the <a href="http://docs.python.org/2/library/stdtypes.html?highlight=update#dict.update" rel="nofollow">update() function</a> to update the state, parent, children, etc. of a node, where the code is as follows:</p>
  
  <pre><code>class Node:
  
      def __init__(self, state, parent=None, action=None, path_cost=0):
          "Create a search tree Node, derived from a parent by an action."
          update(self, state=state, parent=parent, action=action, 
                  path_cost=path_cost, depth=0)
          if parent:
              self.depth = parent.depth + 1
  </code></pre>
  
  <p>I've been stuck on this for a while now and am unsure how to proceed. I would greatly appreciate any suggestions to help fix this problem. Thank you!</p>