On Thu, May 6, 2010 at 4:09 AM, Florian Weimer <f...@deneb.enyo.de> wrote: > As far as I can see, the compression-related APIs (gzip, zlib, bzip2) > in Python 2.5 have three distinct APIs. Is there really no unified > interface, or am I missing something?
bz2.BZ2File and gzip.GzipFile both offer a file-like interface for reading/writing compressed files in their respective formats. The gzip module is already built on top of the zlib module, so there's no ZlibFile. zlib and bz2 also both offer compatible one-shot compress() and decompress() functions. So, the interfaces are sorta "unified", although it is true they're not grouped into a single generic "compression" module. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list