title: Python: AttributeError: x node has no attribute 'y'
body: <p>This is another question in vein of my previous one about a project. </p>
  
  <p>I have read some other (answered) questions related to this, but I did not understand the answers much at all, and am hoping to get better understanding.</p>
  
  <p>I am attempting to implement a simplified version of a larger program that I am working on for a project. The issue I am encountering is that it's giving me an error I don't understand, it is more confusing because the code I use for declaring the class is pulled directly from the 'full' code where it works fine.</p>
  
  <p>The declaration of a new class is here. It is working in another program.</p>
  
  <pre><code>class node:
      def __init__(self):
          self.farmer, self.wolf, self.sheep, self.cabbage = False, False, False, False
          self.parent = None
          self.cost = 0
  </code></pre>
  
  <p>But when I attempt to use it with this code:</p>
  
  <pre><code>parent = node
  fchild = node
  schild = node
  wchild = node
  cchild = node
  
  fchild = parent
  fchild.farmer != fchild.farmer
  fchild.parent = parent
  fchild.cost += 1
  </code></pre>
  
  <p>The result is an error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "boolfliptest.py", line 17, in &lt;module&gt;
      fchild.farmer != fchild.farmer
  AttributeError: class node has no attribute 'farmer'
  </code></pre>
  
  <p>As I said, I have seen other questions about this topic, but I did not understand the answers, and I am further confused because it works on the other program. Is there something wrong with what I'm doing here? Thanks for any responses.</p>