[Python-Dev] zipfile.py

Fredrik Lundh fredrik@pythonware.com
Fri, 17 Dec 1999 10:06:20 +0100


James C. Ahlstrom wrote:
> > Did anyone look at this yet?
> > 
> >    ftp://ftp.interet.com/pub/pylib.html
> > 
> >    ftp://ftp.interet.com/pub/zipfile.py
> 
> I went to look for it, but I think that was before you put zipfile up.

just a few comments (from reading the docs):

-- it would be great if "open" could take an open file
object as well as a file name.

(in this case, you also need to document what you
expect from the underlying file object: read, write,
seek, tell should be enough, right?  haven't looked
at the code -- assuming it works, I'm only interested
in the interface)

-- or you could nuke "open" and pass those arguments
to the constructor instead.

-- I assume "open" adds "b" to the given mode argument.

-- "dir" looks a bit strange.  and hey, there's no "listdir"
in there.  I'd prefer a recursive "listdir" method, which
takes an optional "depth" argument (e.g. 0=this dir,
1=this dir and first subdir, None=infinity, i.e. the full
tree).

that's all for now.

</F>