[Python-checkins] r57309 - sandbox/trunk/import_in_py/_importlib.py
brett.cannon
python-checkins at python.org
Thu Aug 23 04:06:24 CEST 2007
Author: brett.cannon
Date: Thu Aug 23 04:06:24 2007
New Revision: 57309
Modified:
sandbox/trunk/import_in_py/_importlib.py
Log:
With the source loader now being stateless, merging it into PyFileImporter
would not be too difficult. Add a comment to this effect about how to go about
this.
Modified: sandbox/trunk/import_in_py/_importlib.py
==============================================================================
--- sandbox/trunk/import_in_py/_importlib.py (original)
+++ sandbox/trunk/import_in_py/_importlib.py Thu Aug 23 04:06:24 2007
@@ -337,6 +337,14 @@
class _PyFileLoader(object):
+ # XXX Still smart to have this as a separate class? Or would it work
+ # better to integrate with PyFileImporter? Could cache _is_pkg info.
+ # FileImporter can be changed to return self instead of a specific loader
+ # call. Otherwise _base_path can be calculated on the fly without issue if
+ # it is known whether a module should be treated as a path or package to
+ # minimize stat calls. Could even go as far as to stat the directory the
+ # importer is in to detect changes and then cache all the info about what
+ # files were found (if stating directories is platform-dependent).
"""Load a Python source or bytecode file."""
More information about the Python-checkins
mailing list