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.

Author pitrou
Recipients Ramchandra Apte, eric.snow, pitrou, rhettinger, serhiy.storchaka
Date 2013-02-02.09:02:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359795604.3476.6.camel@localhost.localdomain>
In-reply-to <1359795209.13.0.483546013846.issue17100@psf.upfronthosting.co.za>
Content
> > That's O(n), with many spurious insertions and deletions.
> 
> Any implementation is O(n).

For rotate() perhaps (but still, it can be more efficient in that it can
just move the list head once instead of repeatedly deleting and
inserting elements). But rotate_at() / rotate_after() can probably be
O(1), unless I'm missing something.

> > deques already allow rotating.
> 
> I agree that the rotation makes some sense for such collections as
> deque or OrderedDict (although it is easy implemented in user code).
> But there are no rotate_at() and rotate_after() in deque.

That's because a deque is not a mapping ;-) In other words, if a deque
was enough I'd be using a deque, not a OrderedDict.
History
Date User Action Args
2013-02-02 09:02:56pitrousetrecipients: + pitrou, rhettinger, eric.snow, Ramchandra Apte, serhiy.storchaka
2013-02-02 09:02:56pitroulinkissue17100 messages
2013-02-02 09:02:56pitroucreate