]> granicus.if.org Git - python/commitdiff
Issue #15508: Fix the docstring for __import__ to not mention negative
authorBrett Cannon <brett@python.org>
Mon, 30 Jul 2012 21:45:54 +0000 (17:45 -0400)
committerBrett Cannon <brett@python.org>
Mon, 30 Jul 2012 21:45:54 +0000 (17:45 -0400)
'level' values and set its document default value to 0.

Thanks to Arfrever Frehtes Taifersar Arahesis for filing the bug.

Misc/NEWS
Python/bltinmodule.c

index e628f748685ab5c195a98ce79f1bcb25ccabfd9f..234b4c23eebaee46e8fc5a8d17624caa5bb17503 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,10 @@ What's New in Python 3.3.0 Beta 2?
 Core and Builtins
 -----------------
 
+- Issue #15508: Fix the docstring for __import__ to have the proper default
+  value of 0 for 'level' and to not mention negative levels since they are
+  not supported.
+
 - Issue #15425: Eliminated traceback noise from more situations involving
   importlib
 
index 80ac7f1293634bb406766d3d057cc5566e5bd943..3617b5a056017d9e598090954681a20167b5fb3e 100644 (file)
@@ -195,7 +195,7 @@ builtin___import__(PyObject *self, PyObject *args, PyObject *kwds)
 }
 
 PyDoc_STRVAR(import_doc,
-"__import__(name, globals={}, locals={}, fromlist=[], level=-1) -> module\n\
+"__import__(name, globals={}, locals={}, fromlist=[], level=0) -> module\n\
 \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\
@@ -208,8 +208,7 @@ empty list to emulate ``import name''.\n\
 When importing a module from a package, note that __import__('A.B', ...)\n\
 returns package A when fromlist is empty, but its submodule B when\n\
 fromlist is not empty.  Level is used to determine whether to perform \n\
-absolute or relative imports.  -1 is the original strategy of attempting\n\
-both absolute and relative imports, 0 is absolute, a positive number\n\
+absolute or relative imports. 0 is absolute while a positive number\n\
 is the number of parent directories to search relative to the current module.");