title: Circular dependency in Python
body: <p>I have two files, <code>node.py</code> and <code>path.py</code>, which define two classes, <code>Node</code> and <code>Path</code>, respectively.</p>
  
  <p>Up to today, the definition for <code>Path</code> referenced the <code>Node</code> object, and therefore I had done</p>
  
  <pre><code>from node.py import *
  </code></pre>
  
  <p>in the <code>path.py</code> file.</p>
  
  <p>However, as of today I created a new method for <code>Node</code> that references the <code>Path</code> object.</p>
  
  <p>I had problems when trying to import <code>path.py</code>: I tried it, and when the program ran and called the <code>Path</code> method that uses <code>Node</code>, an exception rose about <code>Node</code> not being defined.</p>
  
  <p>What do I do?</p>