Bugs item #1631769, was opened at 2007-01-09 15:26 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1631769&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Extension Modules Group: Python 2.6 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Christos Georgiou (tzot) Assigned to: Raymond Hettinger (rhettinger) Summary: Discrepancy between iterating empty and non-empty deques Initial Comment: >>> from collections import deque >>> empty= deque() >>> nonempty= deque([None]) >>> iter_empty= iter(empty) >>> iter_nonempty= iter(nonempty) >>> empty.append(1) >>> nonempty.append(1) >>> iter_empty.next() Traceback (most recent call last): File "<pyshell#16>", line 1, in <module> iter_empty.next() StopIteration >>> iter_nonempty.next() Traceback (most recent call last): File "<pyshell#17>", line 1, in <module> iter_nonempty.next() RuntimeError: deque mutated during iteration >>> If the RuntimeError is the intended behaviour for a modified deque after its iterator has been created, then iter_empty.next() should also raise the same RuntimeError. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2007-01-09 15:46 Message: Logged In: YES user_id=80475 Originator: NO Fixed in rev 53299, ---------------------------------------------------------------------- Comment By: Christos Georgiou (tzot) Date: 2007-01-09 15:29 Message: Logged In: YES user_id=539787 Originator: YES Assigned to Raymond as requested in http://mail.python.org/pipermail/python-dev/2007-January/070528.html ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1631769&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com