Josh Rosenberg added the comment:

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.

----------
nosy: +josh.r

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23793>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to