[issue19087] bytearray front-slicing not optimized

STINNER Victor report at bugs.python.org
Mon Sep 30 01:03:17 CEST 2013


STINNER Victor added the comment:

Oh, by the way:

> $ ./python -m timeit  "b = bytearray(); a = b'x'"  "for i in range(10000): b += a"  "bytes(b)"

I'm not sure that it is what you expected: bytearray() is only initialized once ("setup" of timeit). You probably want to reinitialize at each loop.

----------

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


More information about the Python-bugs-list mailing list