Mutating a list while looping
<p>I am trying to loop through a list and mutate the list I'm working on by making a copy. I am getting the following error but am unsure how to fix:</p>

<pre><code>     52 def match_jugglers(list_of_jugglers):
     53     while len(list_of_jugglers) &gt; 0:
---&gt; 54         jugglers = list_of_jugglers[:]
     55         for juggler in jugglers:
     56             for preference in juggler.preferences:

TypeError: sequence index must be integer, not 'slice'
</code></pre>

<p>Any suggestions? Thanks in advance.</p>

<p>UPDATE 1: list_of_jugglers is a deque(), sorry should have mentioned that.
UPDATE 2: Um, so I'm an idiot in thinking I could slice a deque() and make a copy -- was still thinking list in my head (thus the original description). </p>
