Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 78338:2a4ca86cc2b7
Issue #15508: Fix the docstring for __import__ to not mention negative
'level' values and set its document default value to 0.
Thanks to Arfrever Frehtes Taifersar Arahesis for filing the bug.
| author | Brett Cannon <brett@python.org> |
|---|---|
| date | Mon, 30 Jul 2012 17:45:54 -0400 |
| parents | 837d51ba1aa2 |
| children | 4240282a9f4a |
line wrap: on
line diff
--- a/Python/bltinmodule.c Mon Jul 30 20:01:13 2012 +0300 +++ b/Python/bltinmodule.c Mon Jul 30 17:45:54 2012 -0400 @@ -195,7 +195,7 @@ } 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 @@ 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.");
