diff options
author | Brett Cannon <bcannon@gmail.com> | 2010-09-27 21:08:38 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2010-09-27 21:08:38 (GMT) |
commit | 5305a998d587f7669dd751ccc3f49d6245c60840 (patch) | |
tree | d468558235c2e791c2a873e454a51ef76e053c37 /Python/bltinmodule.c | |
parent | 1771b54bed1faa2d8216d3d9d76d3f604e93336d (diff) | |
download | cpython-5305a998d587f7669dd751ccc3f49d6245c60840.zip cpython-5305a998d587f7669dd751ccc3f49d6245c60840.tar.gz cpython-5305a998d587f7669dd751ccc3f49d6245c60840.tar.bz2 |
Since __import__ is not designed for general use, have its docstring point
people towards importlib.import_module().
Closes issue #7397.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 60bceb7..2e8d6e2 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -173,8 +173,12 @@ builtin___import__(PyObject *self, PyObject *args, PyObject *kwds) PyDoc_STRVAR(import_doc, "__import__(name, globals={}, locals={}, fromlist=[], level=-1) -> module\n\ \n\ -Import a module. The globals are only used to determine the context;\n\ -they are not modified. The locals are currently unused. The fromlist\n\ +Import a module. Because this function is meant for use by the Python\n\ +interpreter and not for general use it is better to use\n\ +importlib.import_module() to programmatically import a module.\n\ +\n\ +The globals argument is only used to determine the context;\n\ +they are not modified. The locals argument is unused. The fromlist\n\ should be a list of names to emulate ``from name import ...'', or an\n\ empty list to emulate ``import name''.\n\ When importing a module from a package, note that __import__('A.B', ...)\n\ |