[Python-Dev] LZMA compression support in 3.3

Terry Reedy tjreedy at udel.edu
Sat Aug 27 21:47:00 CEST 2011


On 8/27/2011 9:47 AM, Nadeem Vawda wrote:

> I'd like to propose the addition of a new module in Python 3.3. The 'lzma'
> module will provide support for compression and decompression using the LZMA
> algorithm, and the .xz and .lzma file formats. The matter has already been
> discussed on the tracker<http://bugs.python.org/issue6715>, where there seems
> to be a consensus that this is a desirable feature. What are your thoughts?

As I read the discussion, the idea has been more or less accepted in 
principle. However, the current patch is not and needs changes.

> The proposed module's API will be very similar to that of the bz2 module;
> the only differences will be additional keyword arguments to some functions,
> for specifying container formats and detailed compressor options.

I believe Antoine suggested a PEP. It should summarize the salient 
points in the long tracker discussion into a coherent exposition and 
flesh out the details implied above. (Perhaps they are already in the 
proposed doc addition.)

> The implementation will also be similar to bz2 - basic compressor and
> decompressor classes written in C, with convenience functions and a file
> interface implemented on top of those in Python.

I would follow Martin's suggestions, including doing all i/o with the io 
module and the following:
"So I would propose that a very thin C layer is created around the C
library that focuses on the actual algorithms, and that any higher
layers (in particular file formats) are done in Python."

If we minimize the C code we add and maximize what is done in Python, 
that would maximize the ease of porting to other implementations. This 
would conform to the spirit of PEP 399.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list