title: How to clone a queue in python?
body: <p>I have got a piece of code where I have a priority queue and I am trying to clone to traverse,</p>
  
  <pre><code>import Queue as Q
  
  import copy
  
      q1 = Q.PriorityQueue()
  
      def printQueue(q):
          while not q.empty():
              print (q.get()),
          print ''
  
      q1.put((5,'s'))
      q1.put((2,'e'))
      q1.put((0,'a'))
      q1.put((0,'z'))
      printQueue(copy.copy(q1)) 
      print 'second'
      printQueue(copy.copy(q1))
  </code></pre>
  
  <p>I found on the web that I can do clone using copy.copy. However in my code, it is not working. When I call prinQueue for the second time, by that time the priority queue is empty. Could somebody point out what is wrong with the code?   </p>