On 13/02/2021 19:12, Dan Stromberg wrote:
> On Sat, Feb 13, 2021 at 10:25 AM duncan smith
> wrote:
>
>> On 12/02/2021 03:04, Terry Reedy wrote:
>>> On 2/11/2021 3:22 PM, duncan smith wrote:
>>>
It seems that I can mutate a deque while iterating over it if I
assign to an index, bu
PM
To: duncan smith
Cc: Python List
Subject: Re: mutating a deque whilst iterating over it
On Sat, Feb 13, 2021 at 10:25 AM duncan smith
wrote:
> On 12/02/2021 03:04, Terry Reedy wrote:
> > On 2/11/2021 3:22 PM, duncan smith wrote:
> >
> >>It seems that I can mutate a
On Sat, Feb 13, 2021 at 10:25 AM duncan smith
wrote:
> On 12/02/2021 03:04, Terry Reedy wrote:
> > On 2/11/2021 3:22 PM, duncan smith wrote:
> >
> >>It seems that I can mutate a deque while iterating over it if I
> >> assign to an index, but not if I append to it. Is this the intended
> >
On 12/02/2021 03:04, Terry Reedy wrote:
> On 2/11/2021 3:22 PM, duncan smith wrote:
>
>> It seems that I can mutate a deque while iterating over it if I
>> assign to an index, but not if I append to it. Is this the intended
>> behaviour?
>
> Does the deque doc say anything about mutation w
On 2/11/2021 3:22 PM, duncan smith wrote:
It seems that I can mutate a deque while iterating over it if I
assign to an index, but not if I append to it. Is this the intended
behaviour?
Does the deque doc say anything about mutation while iterating?
(Knowing the author of deque, I would
On 11Feb2021 20:22, duncan smith wrote:
> It seems that I can mutate a deque while iterating over it if I
>assign to an index, but not if I append to it. Is this the intended
>behaviour? It seems a bit inconsistent. Cheers.
I think that just means that the deque didn't _notice_ your change i
On 12/02/2021 09.22, duncan smith wrote:
> Hello,
> It seems that I can mutate a deque while iterating over it if I
> assign to an index, but not if I append to it. Is this the intended
> behaviour? It seems a bit inconsistent. Cheers.
Yes, and no! Agree and disagree. (see how decisive I ca
Hello,
It seems that I can mutate a deque while iterating over it if I
assign to an index, but not if I append to it. Is this the intended
behaviour? It seems a bit inconsistent. Cheers.
Duncan
>>> from collections import deque
>>> d = deque(range(8))
>>> it = iter(d)
>>> next(it)
0
>>> d[1