tarfile vs zipfile

Seth P seth-p at outlook.com
Mon Mar 2 20:01:02 EST 2015


Is there a reason tarfile and zipfile don't use the same method/member names, where it makes sense?  Consider the following six methods/members, which I would expect to be the same (with the possible exception of mtime vs date_time, which are of different types).  It almost seems like someone went out of their way to make it difficult to use them interchangeably.

tarfile              zipfile
	
  TarFile              ZipFile
    getmember(name)      getinfo(name)
    getmembers()         infolist()
    getnames()           namelist()
	
  TarInfo              ZipInfo
    name                 filename
    mtime                date_time
    size                 file_size



More information about the Python-list mailing list