[Python-Dev] Zipping Zope3
Just van Rossum
just@letterror.com
Wed, 18 Dec 2002 10:58:52 +0100
Moore, Paul wrote:
> .... and I've just added a comment expressing some concerns.
Likewise ;-)
> I think we need a PEP about now, pinning down the "abstract"
> import hook interface. What zipimport does risks turning into
> a de-facto requirement, before we have any other hooks to
> compare with.
True.
> My specific issue is with get_data, which is totally unneeded
> for the import protocol itself (although it does solve real,
> related issues). I don't think it should be a requirement of
> the import hook API. Documenting it as an optional interface
> which hooks may choose to support may be reasonable, though.
By no means it will be a *required* part of the protocol, if it'll be
part of it at all. I just quickly added it as it's simply a method
that's needed for zipimporter objects.
I like to look at the big issue the other way around: if we had a
Virtual File System protocol it would be a snap to add importing
capabilities. What we then need is Zip file support for that VFS, and
the actual import hook could be completely independent from Zip file
support: it would work for *any* VFS implementation as it's generic.
The importer protocol should be in no way hard-wired to any
file-system-like properties (and indeed it isn't).
> [I can construct theoretical use cases where it could be hard
> to support get_data. But I don't like theoretical use cases
> any more than anyone else - I'm just suggesting that we wait
> for practical experience before adding anything more to what
> is currently a nice, clean, and simple API]
Don't worry: I couldn't agree with you more.
> PS If Just doesn't want to, I'll volunteer to write such a PEP.
I've started, but I'm sure I can use some help. I'll send you my draft
when I'm stuck ;-) Thanks for the offer; we could surely do this
together.
> But be warned, if I do, I'll probably indulge my instincts
> and make the API as minimal as I can get away with (I *like*
> the iterator interface :-))
The iterator interface is a great example for me, too: it's a piece of
art ;-)
Just