-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make deques a full MutableSequence by adding index(), insert(), and copy() #67892
Comments
Attaching an updated patch with documentation updates and tests. |
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. |
Then the patch LGTM except few nitpicks. |
New changeset 3d33be07c5a2 by Raymond Hettinger in branch 'default': |
Thank you for looking it over. |
Did you noticed my comments on Rietveld? You can found Rietveld messages in the Spam folder. |
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
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: