Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee='https://github.com/rhettinger'closed_at=<Date2015-03-21.08:39:04.408>created_at=<Date2015-03-19.07:11:27.424>labels= ['type-feature', 'library']
title='Make deques a full MutableSequence by adding index(), insert(), and copy()'updated_at=<Date2015-03-21.09:28:50.300>user='https://github.com/rhettinger'
When appending fails, the deque is left in changed state. I would do it in different way. First append new item (can fail), and then make circular shift (never fail). This also should be faster (up to 2 times). Most code can be shared between rotate() and circular shift operation.
For now, I prefer to continue using rotate() as a primitive and am saving circular shifts for another day (likely when I start working on slices).
FWIW, the only way for append() to fail is a memory error; in which case, I would ilke to stop doing any work at alll and return a soon as possible, even if it means leaving the deque in a reordered state.