title: Circular Queue Python
body: <p>I am trying to make a circular queue in Python so that when the last element in the array is reached to points back to the head. I am working on the enqueue method and I am having some issues. I am trying to have an array of size 4 and I am able to enqueue values up to the 4th spot, but when it executes the elif statement I receive this error. </p>
  
  <p>TypeError: unsupported operand type(s) for +: 'Node' and 'int'</p>
  
  <p>Any thoughts? </p>
  
  <pre><code>class Node(object):
      def __init__(self, item = None):
          self.item = [None] * 4
          self.next = None
          self.previous = None
  
  class CircularQueue(object):
      def __init__(self):
          self.length = 0
          self.head = None
          self.tail = None
      def enqueue(self, x):
          newNode = Node(x)
          newNode.next = None
          if self.head == None:
              self.head = newNode
              self.tail = newNode
          elif self.length &lt; 4:
              self.tail.next = newNode
              newNode.previous = self.tail
              self.tail = newNode
          else:
              self.tail = (self.tail + 1) % 4
          self.length += 1
      def dequeue(self):
          if self.count == 0:
              print ("The Queue is empty!")
          self.count -= 1
          return self.item.pop()
      def size(self):
          return self.length
  </code></pre>