title: Python Attribute error
body: <p>having problems with this error in python:</p>
  
  <pre><code>File "F:\dykrstra", line 36, in route
  while node.label != node.prevNode.label:
  AttributeError: 'NoneType' object has no attribute 'label'
  </code></pre>
  
  <p>Inside this while loop:</p>
  
  <pre><code> while node.label != node.prevNode.label:
      node = node.prevNode
      labels.append(node.label)
  </code></pre>
  
  <p>I think it relates to this:</p>
  
  <pre><code>   def __init__(self, label):
          self.label = label
          self.neighbours = []
          self.distances = []
          self.prevNode = None
          self.totalDistance = 0
  </code></pre>
  
  <p>I'm not sure why prevNode doesn't like the nothing being assigned to it, please help.</p>