[Python-checkins] bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100)
miss-islington
webhook-mailer at python.org
Wed Jan 6 12:42:34 EST 2021
https://github.com/python/cpython/commit/ff8458b918050168acda1ad6d079f52b8effa821
commit: ff8458b918050168acda1ad6d079f52b8effa821
branch: master
author: Yair Frid <fridyair at gmail.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-01-06T09:42:10-08:00
summary:
bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100)
Automerge-Triggered-By: GH:brettcannon
files:
A Misc/NEWS.d/next/Documentation/2021-01-04-22-14-22.bpo-42811.HY2beA.rst
M Doc/library/importlib.rst
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index f1c444fe8232c..fee5df84dffcb 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -1476,7 +1476,7 @@ an :term:`importer`.
If **name** has no leading dots, then **name** is simply returned. This
allows for usage such as
- ``importlib.util.resolve_name('sys', __package__)`` without doing a
+ ``importlib.util.resolve_name('sys', __spec__.parent)`` without doing a
check to see if the **package** argument is needed.
:exc:`ImportError` is raised if **name** is a relative module name but
diff --git a/Misc/NEWS.d/next/Documentation/2021-01-04-22-14-22.bpo-42811.HY2beA.rst b/Misc/NEWS.d/next/Documentation/2021-01-04-22-14-22.bpo-42811.HY2beA.rst
new file mode 100644
index 0000000000000..768508e0ce1c1
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2021-01-04-22-14-22.bpo-42811.HY2beA.rst
@@ -0,0 +1,2 @@
+Updated importlib.utils.resolve_name() doc to use __spec__.parent
+instead of __package__. (Thanks Yair Frid.)
More information about the Python-checkins
mailing list