This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kristjan.jonsson
Recipients BreamoreBoy, amaury.forgeotdarc, gregory.p.smith, kristjan.jonsson, pitrou, rbcollins
Date 2010-08-09.13:53:54
SpamBayes Score 2.1198903e-06
Marked as misclassified No
Message-id <1281362036.76.0.478625630252.issue5804@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-08-09 13:53:57kristjan.jonssonsetrecipients: + kristjan.jonsson, gregory.p.smith, amaury.forgeotdarc, pitrou, rbcollins, BreamoreBoy
2010-08-09 13:53:56kristjan.jonssonsetmessageid: <1281362036.76.0.478625630252.issue5804@psf.upfronthosting.co.za>
2010-08-09 13:53:55kristjan.jonssonlinkissue5804 messages
2010-08-09 13:53:54kristjan.jonssoncreate