title: 'Queue' object has no attribute 'size'
body: <p>I have seen other examples of this happening on StackOverflow, but I didn't understand any of the answers (I'm still a new programmer,) nor did the other examples I saw look quite like mine, else I wouldn't post this question.</p>
  <p>I'm running Python 3.2 on Windows 7.</p>
  <p>I have never had this happen to me before and I've done classes this way many times, so I don't really know what is different this time. The only difference is that I didn't make all of the Class file; I was given a template to fill in and a test file to try it on. It worked on the test file, but is not working on my file. I have been calling on the methods in the class in the exact same way as the test file (e.g. <code>Lineup.size()</code>)</p>
  <p>This is my Class:</p>
  <pre class="lang-py prettyprint-override"><code>class Queue:
      
      # Constructor, which creates a new empty queue:
      def __init__(self):
          self.__items = []
          
      # Adds a new item to the back of the queue, and returns nothing:
      def queue(self, item):
          self.__items.insert(0,item)
          return
          
      # Removes and returns the front-most item in the queue.  
      # Returns nothing if the queue is empty.
      def dequeue(self):
          if len(self.__items) == 0:
              return None
          else:
              return self.__items.pop()
          
      # Returns the front-most item in the queue, and DOES NOT change the queue.  
      def peek(self):
          if len(self.__items) == 0:
              return None
          else:
              return self.__items[(len(self.__items)-1)]
          
      # Returns True if the queue is empty, and False otherwise:
      def is_empty(self):
          return len(self.__items) == 0
      
      # Returns the number of items in the queue:
      def size(self):
          return len(self.__items)
      
      # Removes all items from the queue, and sets the size to 0:
      def clear(self):
          del self.__items[0:len(self.__items)]
          return
          
      # Returns a string representation of the queue:
      def __str__(self):
          return &quot;&quot;.join(str(i) for i in self.__items)
  </code></pre>
  <p>This is my program:</p>
  <pre class="lang-py prettyprint-override"><code>from queue import Queue
  
  Lineup = Queue()
  
  while True:
      decision = str(input(&quot;Add, Serve, or Exit: &quot;)).lower()
      if decision == &quot;add&quot;:
          if Lineup.size() == 3:
              print(&quot;There cannot be more than three people in line.&quot;)
              continue
          else:
              person = str(input(&quot;Enter the name of the person to add: &quot;))
              Lineup.queue(person)
              continue
      elif decision == &quot;serve&quot;:
          if Lineup.is_empty() == True:
              print(&quot;The lineup is already empty.&quot;)
              continue
          else:
              print(&quot;%s has been served.&quot;%Lineup.peek())
              Lineup.dequeue()
              continue
      elif (decision == &quot;exit&quot;) or (decision == &quot;quit&quot;):
          break
      else:
          print(&quot;%s is not a valid command.&quot;)
          continue
  </code></pre>
  <p>And this is my error message when I enter &quot;add&quot; as my decision variable:</p>
  <p><em>line 8, in 
  builtins.AttributeError: 'Queue' object has no attribute 'size'</em></p>
  <p>So, what is going on here? What is different about this one?</p>