zipimport._zip_directory_cache interface

_zip_directory_cache is a cache for modules imported by zipimporter. It's a normal dictionary exposing gory details of zipimport implementation. It wouldn't be a bad thing on it's own, but pkgutil.py uses this knowledge, while _zip_directory_cache has no single test nor documentation (besides info in docstring). It's a bit of a pain to actually implement this in other python implementations (especially that cache can be internal and exposed differently). I think it should be either specified better (and stripped from _) or zipimport should expose some nicer interface to it's cache. What do you think? Cheers, fijal

On Mon, May 26, 2008 at 10:46 AM, Maciej Fijalkowski <fijall@gmail.com> wrote:
_zip_directory_cache is a cache for modules imported by zipimporter. It's a normal dictionary exposing gory details of zipimport implementation. It wouldn't be a bad thing on it's own, but pkgutil.py uses this knowledge, while _zip_directory_cache has no single test nor documentation (besides info in docstring). It's a bit of a pain to actually implement this in other python implementations (especially that cache can be internal and exposed differently). I think it should be either specified better (and stripped from _) or zipimport should expose some nicer interface to it's cache. What do you think?
How useful is the cache access? If it is not necessary, I think pkgutil just needs to stop using it. If it is useful to access, the question becomes who exposes the cache; the module, the importers, or the loaders? -Brett
participants (2)
-
Brett Cannon
-
Maciej Fijalkowski