[Python-Dev] Release manager pronouncement needed: PEP 302 Fix

Georg Brandl g.brandl at gmx.net
Thu Jul 27 10:47:30 CEST 2006


Neal Norwitz wrote:
> What is the behaviour that was added which broke compliance?  What is
> the benefit of the behaviour?

sys.path_importer_cache is now used to cache if a real directory
exists on the filesystem. Previously, a value of None for a given
sys.path entry told find_module that no import hook exist, so it should
look for a filesystem directory. Now, the entry is set to True if that
directory really exists and to False if it doesn't exist, thus saving
quite a few open() calls to files in these not existing dirs.

>>From your description of fixing the problem, it seems there's some
> risk invovled as it's modiyfing import.c, plus adding new features.
> What is your recommendation?

I would prefer fixing the docs. Importing from filesystem directories
is common enough to be special cased.

Georg



More information about the Python-Dev mailing list