A few things to improve in tarfile’s doc: a) I found the heading “The following variables are available on module level” strange; does “variable” mean that users are able to edit tarfile.ENCODING to control the default encoding used? The answer is no, as ENCODING is bound to a function default argument value and a class attribute at import time. I suggest changing this heading for something like “Module-level constants”, and move it before the doc for the *_FORMATS constants (the attached diff makes it look like I moved these constants, but I actually moved ENCODING—same result). b) The doc does not say that the availability of compression formats depends on the optional compilation of some modules. Someone following the link to the module docs for gzip, bz2 or lzma can find the info, but I think a bit more explicitness wouldn’t hurt. The attached patch for 3.2 tries to inline the info, but is a bit clumsy; alternatively, a table like this could be added near the top: Support depends on the availability of certain optional modules: ========= =========================================== ============= Format Description Requires ========= =========================================== ============= ``xz`` xz'ed tar file (:file:`.tar.xz`) :mod:`lzma` ``bz2`` bzip2'ed tar file (:file:`.tar.bz2`) :mod:`bz2` ``gz`` gzip'ed tar file (:file:`.tar.gz`) :mod:`gzip` ========= =========================================== ============= c) The seealso section links to zipfile, just like the into text, but not to shutil. Please let me know what suggestions you approve or reject and I’ll commit them.
a) Good point, a case of sloppy naming. b) IMO a table is a tad too much. The amount of different compression methods is still quite small. My patch proposes a simpler approach. c) A link to shutil is very useful. BTW, thanks for the effort.