Serhiy Storchaka added the comment: 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.
---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23704> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com