Message41975
Logged In: YES
user_id=113328
Be aware that this doesn't solve all of the issues (although it
does solve a large class of them). Some applications require
a real filename (wxPython did until recently for image data)
and some need to stat the file (Guido quoted Zope).
At the very least it should be made clear that this is an
*optional* part of the interface. Application code should
always be prepared for an importer not to support get_data (if
only by saying it can't work from a data store managed by
this sort of hook).
My preference is for keeping the importer interface minimal
and clean. At the moment 2 functions (find_module and
get_module) are all that is required - and these can be in
separate classes. Which class should have the get_data
method? Which class gets assigned to __importer__? Is it
the hook's responsibility to set __importer__ (yet another
responsibility)?
I think it's time for a PEP. Not for zipimporter, but purely for
the import hook interface. That would be the place to argue
such issues as I raised in the paragraph above. We need to
remain clear on what the API requires vs what zipimporter
does, to give writers of new hooks a decent chance. |
|
Date |
User |
Action |
Args |
2007-08-23 15:18:58 | admin | link | issue652586 messages |
2007-08-23 15:18:58 | admin | create | |
|