classification
Title: collections.deque.__init__ doesn't initialize
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Horpner, gvanrossum, rhettinger
Priority: normal Keywords:

Created on 2007-12-12 17:20 by Horpner, last changed 2007-12-13 05:21 by rhettinger. This issue is now closed.

Messages (3)
msg58501 - (view) Author: Neil Cerutti (Horpner) Date: 2007-12-12 17:20
Passing an interable to the __init__ method of an existing deque 
appends those elements, rather than reinitializing the deque with the 
items. This is contrary to how list.__init__ works.

test_deque.py verifies the (possibly) incorrect behavior.
msg58502 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-12-12 17:42
I agree, I put the list behavior in on purpose.

Should be fixed in 2.6, not 2.5 though, since it's a feature.
msg58522 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2007-12-13 05:21
Checked in. See rev 59478.
History
Date User Action Args
2007-12-13 05:21:31rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg58522
2007-12-12 22:18:21rhettingersetversions: + Python 2.6, - Python 2.5
2007-12-12 17:42:01gvanrossumsetassignee: rhettinger
messages: + msg58502
nosy: + gvanrossum
2007-12-12 17:20:43Horpnercreate