Note, I thought of the "tail" argument to reflect the "unused_data"
member of the decompressobj(). But a more useful way is actually this:
result, offset = zlib.decompress(buffer, offset=0)
if offset<len(buffer):
result2, offset = zlib.decompress(buffer, offset=offset)
This avoids data copying as much as possible. The presence of a non-
default offset argument, would trigger the "tuple" return value.
We could add the same argument to decompressobj.decompress, and
add "unused_offset" member there for symmetry.
Any thoughts? |