Skip to content

Commit f61951b

Browse files
miss-islingtonoldk1331
authored andcommitted
bpo-32674: Improve the docstring for __import__ (GH-5339) (GH-5489)
Clarify that the level argument is used to determine whether to perform absolute or relative imports: 0 is absolute, while a positive number is the number of parent directories to search relative to the current module. (cherry picked from commit 461d225) Co-authored-by: oldk <oldk1331@users.noreply.github.com>
1 parent 3a04c52 commit f61951b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/bltinmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ PyDoc_STRVAR(import_doc,
243243
"__import__(name, globals=None, locals=None, fromlist=(), level=0) -> module\n\
244244
\n\
245245
Import a module. Because this function is meant for use by the Python\n\
246-
interpreter and not for general use it is better to use\n\
246+
interpreter and not for general use, it is better to use\n\
247247
importlib.import_module() to programmatically import a module.\n\
248248
\n\
249249
The globals argument is only used to determine the context;\n\
@@ -252,8 +252,8 @@ should be a list of names to emulate ``from name import ...'', or an\n\
252252
empty list to emulate ``import name''.\n\
253253
When importing a module from a package, note that __import__('A.B', ...)\n\
254254
returns package A when fromlist is empty, but its submodule B when\n\
255-
fromlist is not empty. Level is used to determine whether to perform \n\
256-
absolute or relative imports. 0 is absolute while a positive number\n\
255+
fromlist is not empty. The level argument is used to determine whether to\n\
256+
perform absolute or relative imports: 0 is absolute, while a positive number\n\
257257
is the number of parent directories to search relative to the current module.");
258258

259259

0 commit comments

Comments
 (0)