title: What is wrong with this Ordered List? AttributeError: 'function' object has no attribute 'data'
body: <p>I'm following the tutorial from <a href="http://interactivepython.org/courselib/static/pythonds/BasicDS/linkedlists.html" rel="nofollow">Interactive Python</a> to make an Ordered List in Python. My code looks like this: </p>
  
  <pre><code>class Node:
      def __init__(self, initdata):
          self.data = initdata
          self.next = None
  
      def getData(self):
          return self.data
  
      def getNext(self):
          return self.next
  
      def setData(self, newdata):
          self.data = newdata
  
      def setNext(self, newnext):
          self.next = newnext
  
  class OrderedList:
      def __init__(self):
          self.head = None
  
      def search(self, item):
          found = False
          stop = False
          current = self.head
          while current != None and not found and not stop:
              if current.getData() == item:
                  found = True
              elif current.getData() &gt; item:
                  stop = True
              else:
                  current = current.getNext()
  
          return found
  
      def add(self, item):
          previous = None
          current = self.head
          stop = False
          while current != None and not stop:
              if current.getData() &gt; item:
                  stop = True
              else:
                  previous = current
                  current = current.getNext()
  
          temp = Node(item)       
          if previous == None:
              temp.setNext(self.head)
              self.head = temp
          else:
              temp.setNext(current)
              previous.setNext(temp)
  
      def remove(self, item):
          previous = None
          current = self.head
          found = False
          while not found:
              if current.getData() == item:
                  found = True
              else:
                  previous = current
                  current = current.getNext()
  
          if previous == None:
              self.head = current.getNext()
          else:
              previous.setNext(current.getNext)
  
      def update(self, olddata, newdata):
          self.remove(olddata)
          self.add(newdata)
  
      def display(self):
          current = self.head
          print("The contents of this list are: ", end='')
          print()
          while current:
              print(current.data)
              current = current.getNext()
  
  myList = OrderedList()
  myList.add(5)
  myList.add(25)
  myList.add(30)
  myList.remove(25)
  myList.display()
  myList.update(5, 30)
  myList.display()
  </code></pre>
  
  <p>It keeps telling me my variable current is a function and doesn't have the atrributes for a Node. How can I fix it and what am I doing wrong?</p>
  
  <p>The output I get:</p>
  
  <pre><code>The contents of this list are: 
  5
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 92, in &lt;module&gt;
    File "&lt;string&gt;", line 88, in &lt;module&gt;
    File "&lt;string&gt;", line 80, in display
  AttributeError: 'function' object has no attribute 'data'
  </code></pre>