Josh Rosenberg added the comment:

I agree with Tim that arbitrarily deciding that insert should behave more like 
appendleft is surprising. This really feels like guessing at what the user 
wants, silently doing something that really isn't predictable.

Any of the following seem nicer (not exactly arguing for any but #1):

1. Raising an exception for full deque
2. Making insert pop left when full (and possibly make insertleft that will pop 
right; the name isn't perfect, but it would make the symmetry between "no 
suffix pops left and 'left' suffix pops right" line up with other deque methods)
3. Adding an optional argument to say which end should be popped (defaulting to 
"raise an exception", probably no good though, since it would break Sequence 
rules.

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

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

Reply via email to