This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josh.r
Recipients josh.r, rhettinger
Date 2015-03-30.21:18:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427750304.67.0.761248726763.issue23793@psf.upfronthosting.co.za>
In-reply-to
Content
The behavior for multiplying or adding doesn't seem quite so intuitive when you allow for a bounded deque. In particular, it doesn't seem obvious that multiplying when the deque is bounded, you'll get results like:

>>> list(deque([1,2], 3) * 2)
[2, 1, 2]

Similarly, when you support non-in-place addition, the bounded-ness of the result depends on the order of the values added.

>>> list(deque([1,2], 3) + deque([1,2], 2))
[1, 2, 1]
>>> list(deque([1,2], 2) + deque([1,2], 3))
[1, 2]

Not saying these are the wrong behaviors, but it's much more weird than what you get with other sequence types (since most sequence types aren't bounded), and possibly why deques didn't include these features in the first place; trying to act like a generalized sequence when you have features that don't fit the model is a titch odd.
History
Date User Action Args
2015-03-30 21:18:24josh.rsetrecipients: + josh.r, rhettinger
2015-03-30 21:18:24josh.rsetmessageid: <1427750304.67.0.761248726763.issue23793@psf.upfronthosting.co.za>
2015-03-30 21:18:24josh.rlinkissue23793 messages
2015-03-30 21:18:24josh.rcreate