03d9b29eee
Not great to use a 'bytes' object as a FIFO buffer, as every slice copies the whole thing. With bytearray, extending it from the right is fast, and with the correct syntax, popping from the left is fast too. see https://stackoverflow.com/a/57748513 https://bugs.python.org/issue19087 https://github.com/python/cpython/commit/5df8a8a1fd6cc6f4469dc7d3994d06e2aea24c52