STINNER Victor <victor.stin...@gmail.com> added the comment: > The code doesn't work nice with general objects supporting the buffer > protocol. The length check suppose that the value has a length, and it is the > size in bytes. The code for bytes_le suppose that the value supports slicing > and concatenating results of the slicing. And all this code is made as fast > as possible. Additional checks and conversions will slowdown it.
I enhanced my PR to also accept memoryview and bytearray in bytes_le. I don't think that performance matters so much here. First we need correctness, accept any bytes-like objects, no? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue29729> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com