Serhiy Storchaka added the comment: The reason of using bytes concatenating rather than accumulating in the list, is that in most cases one of arguments is an empty bytes object (appending to the empty buffer or uncompressing a file with large compression block), and this case is optimized in CPython. In mos cases there is at most one nontrivial bytes concatenation per read operation, and using b''.join() is slower in that case.
---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30468> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com