[issue19087] bytearray front-slicing not optimized

Serhiy Storchaka report at bugs.python.org
Wed Sep 25 17:47:10 CEST 2013


Serhiy Storchaka added the comment:

And the same is for a list. List and bytearray are wrong types for front deleting. I don't think we should increase the size of bytearray, and complicate and slowdown it for such special purpose.

If you want to implement a fifo using bytearray more optimal, defer the deleting until used size less than a half of allocated size. See for example XMLPullParser.read_events() in Lib/xml/etree/ElementTree.py.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19087>
_______________________________________


More information about the Python-bugs-list mailing list