[issue15945] memoryview + bytes fails

Glyph Lefkowitz report at bugs.python.org
Thu Oct 11 21:05:13 CEST 2012


Glyph Lefkowitz added the comment:

It's worth noting that the "buffer()" built-in in Python2 had this behavior, and it enabled a copy-reduction optimization within Twisted's outgoing transport buffer.

There are of course other ways to do this, but it seems like it would be nice to restore this handy optimization; it seems like a bug, or at least an oversight, that the convenience 'bytes+memoryview' (which cannot provide a useful optimization) works, but 'memoryview+bytes' (which would be equally helpful from a convenience perspective _could_ provide a reduction in copying) doesn't.

Despite the bytes.join optimization (which, don't get me wrong, is also very helpful, almost necessary) this remains very useful.

----------
nosy: +glyph

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


More information about the Python-bugs-list mailing list