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 llllllllll
Recipients llllllllll, martin.panter
Date 2016-02-18.19:51:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1455825091.32.0.116639436131.issue26379@psf.upfronthosting.co.za>
In-reply-to
Content
The recipe you showed looks like it is very complicated for the expected use case of decompressing all of the data into a mutable buffer. One difference I see with this and struct.pack_into or socket.recv_into is that in both of those cases we know how large our buffer needs to be. With zlib.decompress there is not a simple way for users to preallocate a buffer to hold the result and need to resort to some looping with a lot of resizes. I think that returning either a mutable or immutable buffer hits 95% of use cases. If we go with the decompress_into method I would strongly advise putting decompress_as_bytearray into the standard library so that users do not need write this themselves.

Thank you for pointing me at the bz2 and LZMA modules. When we come to an agreement on the API I will update bz2 and LZMA so that they match. Should I also update the gzip module?
History
Date User Action Args
2016-02-18 19:51:31llllllllllsetrecipients: + llllllllll, martin.panter
2016-02-18 19:51:31llllllllllsetmessageid: <1455825091.32.0.116639436131.issue26379@psf.upfronthosting.co.za>
2016-02-18 19:51:31lllllllllllinkissue26379 messages
2016-02-18 19:51:30llllllllllcreate