
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2015-03-19 07:11 byrhettinger, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| deque_insert_index_copy3.diff | rhettinger,2015-03-19 07:11 | First draft -- needs doc update and more tests | review | |
| deque_insert_index_copy4.diff | rhettinger,2015-03-21 04:40 | With docs and test | review | |
| Messages (7) | |||
|---|---|---|---|
| msg238761 -(view) | Author: Raymond Hettinger (rhettinger)*![]() | Date: 2015-03-21 04:40 | |
Attaching an updated patch with documentation updates and tests. | |||
| msg238765 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2015-03-21 05:26 | |
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. | |||
| msg238769 -(view) | Author: Raymond Hettinger (rhettinger)*![]() | Date: 2015-03-21 07:41 | |
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. | |||
| msg238771 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2015-03-21 07:45 | |
Then the patch LGTM except few nitpicks. | |||
| msg238776 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2015-03-21 08:37 | |
New changeset3d33be07c5a2 by Raymond Hettinger in branch 'default':Issue 23704: Add index(), copy(), and insert() to deques. Register deques as a MutableSequence.https://hg.python.org/cpython/rev/3d33be07c5a2 | |||
| msg238777 -(view) | Author: Raymond Hettinger (rhettinger)*![]() | Date: 2015-03-21 08:39 | |
Thank you for looking it over. | |||
| msg238779 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2015-03-21 09:28 | |
Did you noticed my comments on Rietveld? You can found Rietveld messages in the Spam folder. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:14 | admin | set | github: 67892 |
| 2015-03-21 09:28:50 | serhiy.storchaka | set | messages: +msg238779 |
| 2015-03-21 08:39:04 | rhettinger | set | status: open -> closed resolution: fixed messages: +msg238777 |
| 2015-03-21 08:37:48 | python-dev | set | nosy: +python-dev messages: +msg238776 |
| 2015-03-21 07:45:17 | serhiy.storchaka | set | messages: +msg238771 |
| 2015-03-21 07:41:12 | rhettinger | set | messages: +msg238769 |
| 2015-03-21 05:26:49 | serhiy.storchaka | set | nosy: +serhiy.storchaka messages: +msg238765 |
| 2015-03-21 04:40:10 | rhettinger | set | files: +deque_insert_index_copy4.diff messages: +msg238761 |
| 2015-03-19 07:26:16 | rhettinger | set | assignee:rhettinger |
| 2015-03-19 07:11:27 | rhettinger | create | |