Kristján Valur Jónsson <krist...@ccpgames.com> added the comment:

decompressobj is indeed "enough".  But if you are doing a lot of this 
(decompressing chunks), then using the unused_data, as it is, involves a lot of 
copying.
If there were a "unused_data_pos" or some equivalent, then it would be possible 
to continue decommpressing with buffer(olddata, unused_data_pos), without 
copying the source data.

The point of the "offset" keyword argument was to have a way to get this end 
position also without having an explicit decompressobj.

I agree that having the result type change to a tuple is not good.

So, a suggestion:
1) Add the unused_data_pos to the decompressobj.
2) (opotional) Add the automatic retrieval of this with a decompress_ex method, 
for convenience, making it usable without creating a decompressobj
3) (optional) Add the "offset" kw argument to decompress and (decompress_ex) 
making the creation of a temporary buffer() object unnecessary.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5804>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to