Christos Georgiou schrieb:
> Is that intentional?

It would have helped if you had said what "that" is you are referring
to, it would also have helped if you had stated an opinion on whether
you believe that to be a bug. For example, I think I would have phrased
your post like this:

"""
If I apply .next() to an iter of a deque that has been modified, I
get a RuntimeError:

py> d=collections.deque()
py> d.append(10)
py> i=iter(d)
py> d.append(10)
py> i.next()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RuntimeError: deque mutated during iteration

Yet when I apply .next() to an iter of an initially-empty deque,
I get StopIteration:

py> d=collections.deque()
py> i=iter(d)
py> d.append(10)
py> i.next()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
StopIteration

Is this a bug? Shouldn't the second example also raise the RuntimeError
as the deque has been modified?
(also, is appending an element a modification or a mutation?)
"""

To this question (.next on an iterator of a modified deque), my answer
would be: "yes, that is a bug".

However, I feel you are referring to a different issue, unfortunately,
I cannot tell from your post what that issue is.

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to