diff options
author | Brett Cannon <brett@python.org> | 2012-04-15 20:08:47 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-04-15 20:08:47 (GMT) |
commit | 6f44d66bc491bad5b8d897a68da68e009e27829d (patch) | |
tree | 311e790c6611c8dc6af47bdadce99e9730fda9fe /Lib/imp.py | |
parent | 7788838473aa3993d29fcf9de25605d492f25d29 (diff) | |
download | cpython-6f44d66bc491bad5b8d897a68da68e009e27829d.zip cpython-6f44d66bc491bad5b8d897a68da68e009e27829d.tar.gz cpython-6f44d66bc491bad5b8d897a68da68e009e27829d.tar.bz2 |
Issue #13959: Rename imp to _imp and add Lib/imp.py and begin
rewriting functionality in pure Python.
To start, imp.new_module() has been rewritten in pure Python, put into
importlib (privately) and then publicly exposed in imp.
Diffstat (limited to 'Lib/imp.py')
-rw-r--r-- | Lib/imp.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/imp.py b/Lib/imp.py new file mode 100644 index 0000000..d7ba344 --- /dev/null +++ b/Lib/imp.py @@ -0,0 +1,22 @@ +"""This module provides the components needed to build your own __import__ +function. Undocumented functions are obsolete. + +In most cases it is preferred you consider using the importlib module's +functionality over this module. + +""" +# (Probably) need to stay in _imp +from _imp import (lock_held, acquire_lock, release_lock, reload, + get_frozen_object, is_frozen_package, init_builtin, + init_frozen, is_builtin, is_frozen, _fix_co_filename) +# Can (probably) move to importlib +from _imp import (get_magic, get_tag, get_suffixes, cache_from_source, + source_from_cache) +# Should be re-implemented here (and mostly deprecated) +from _imp import (find_module, load_module, load_compiled, load_dynamic, + load_package, load_source, NullImporter, + SEARCH_ERROR, PY_SOURCE, PY_COMPILED, C_EXTENSION, + PY_RESOURCE, PKG_DIRECTORY, C_BUILTIN, PY_FROZEN, + PY_CODERESOURCE, IMP_HOOK) + +from importlib._bootstrap import _new_module as new_module |