This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年03月19日 07:11 by rhettinger, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| 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) * (Python committer) | Date: 2015年03月21日 04:40 | |
Attaching an updated patch with documentation updates and tests. |
|||
| msg238765 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | Date: 2015年03月21日 07:45 | |
Then the patch LGTM except few nitpicks. |
|||
| msg238776 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年03月21日 08:37 | |
New changeset 3d33be07c5a2 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) * (Python committer) | Date: 2015年03月21日 08:39 | |
Thank you for looking it over. |
|||
| msg238779 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | 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 | |