diff Python/bltinmodule.c @ 64965:3d490c3a019e

Since __import__ is not designed for general use, have its docstring point people towards importlib.import_module(). Closes issue #7397.
author Brett Cannon <bcannon@gmail.com>
date Mon, 27 Sep 2010 21:08:38 +0000
parents 999d7d212f17
children 55ed5c524428
line wrap: on
line diff
--- a/Python/bltinmodule.c	Mon Sep 27 17:56:36 2010 +0000
+++ b/Python/bltinmodule.c	Mon Sep 27 21:08:38 2010 +0000
@@ -173,8 +173,12 @@
 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\