title: how to implement deep copying of queue in python
body: <p>I want to maintain two queues, Queue A is for pop , Queue B is for backup,  so if i pop all objects out from A, how do I restore Queue A from B?</p>
  
  <pre><code>while (still has input)
       A.push(input)
       B.push(input)
  
  while A is not empty
        A.pop()
  </code></pre>
  
  <p>Then how do I restore A from B???  In the meantime, I still want to keep B as my backup. </p>
  
  <p>I know some very stupid way to do it , like assign one more queue C and then pop all Bout. And then restore B from queue C</p>