diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-02-07 01:15:27 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-02-07 01:15:27 (GMT) |
commit | 2c318a1390e1a84c78d6f0cacaee1d21cc459234 (patch) | |
tree | 97f2579de870e21766febabe4acaaf53b8cd9eb9 /Lib/importlib/NOTES | |
parent | 887b3f2625404f3835d47a63ae7e0ac4ee638cb6 (diff) | |
download | cpython-2c318a1390e1a84c78d6f0cacaee1d21cc459234.zip cpython-2c318a1390e1a84c78d6f0cacaee1d21cc459234.tar.gz cpython-2c318a1390e1a84c78d6f0cacaee1d21cc459234.tar.bz2 |
Rewrite the code implementing __import__ for importlib. Now it is much simpler
and relies much more on meta path finders to abstract out various parts of
import.
As part of this the semantics for import_module tightened up and now follow
__import__ much more closely (biggest thing is that the 'package' argument must
now already be imported, else a SystemError is raised).
Diffstat (limited to 'Lib/importlib/NOTES')
-rw-r--r-- | Lib/importlib/NOTES | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/Lib/importlib/NOTES b/Lib/importlib/NOTES index 3b000ff..05920ad 100644 --- a/Lib/importlib/NOTES +++ b/Lib/importlib/NOTES @@ -1,35 +1,10 @@ to do ///// -* Create sandbox directory for a distutils packaging of what is in Python 2.7. - * Use rpartition for getting the package of a module. - + Make sure that an empty string is acceptable for __package__. - -* Create meta_path importer for sys.path. - - + Document. - -* Refactor __import__. - - + Create a greatest common denominator function for __import__/import_module - that takes in an absolute module name and performs the import. - - - Needs of __import__ - - * Figure out caller's package. - * Import module. - * Set __package__. - * Figure out what module to return. - - - Needs of import_module - - * Resolve name/level. - * Import module. - - + Use GCD import for __import__. - + Use GCD import for import_module. + + Make sure there is a test for the empty string as acceptable for + __package__. * Implement PEP 302 protocol for loaders (should just be a matter of testing). @@ -66,13 +41,11 @@ to do * source_path * bytecode_path - * write_bytecode + * write_bytecode (not abstract) + util - - get_module decorator (new name) - - check_name decorator (new name) - - resolve_name + - get_module decorator (rename: module_for_loader) + machinery @@ -88,6 +61,8 @@ to do * SourceFinder * (?) Loader + - PathFinder + * Write benchmark suite. * OPTIMIZE! |