[Python-Dev] Zipping Zope3

Guido van Rossum guido@python.org
Wed, 18 Dec 2002 08:33:23 -0500


> 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.

I like get_data().  The caller should always be prepared for it to
return an error (how does it do that? raise what? or return None? that
should be specified!).  An importer that can't do this should
implement a version that always reports an error.  This is much easier
on the client than calling hasattr(importer, 'get_data') first or
catching AttributeError.

--Guido van Rossum (home page: http://www.python.org/~guido/)