[Python-checkins] gh-92994: Clarify importlib "check" example (GH-92995)
miss-islington
webhook-mailer at python.org
Sun May 22 22:11:11 EDT 2022
https://github.com/python/cpython/commit/247e059de34ce8117bc4dd7b143f2582c9115f95
commit: 247e059de34ce8117bc4dd7b143f2582c9115f95
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-05-22T19:10:57-07:00
summary:
gh-92994: Clarify importlib "check" example (GH-92995)
Fixes GH-92994
(cherry picked from commit e39cd765610c9099da3b5595186ad16223b670b0)
Co-authored-by: Shantanu <12621235+hauntsaninja at users.noreply.github.com>
files:
M Doc/library/importlib.rst
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index f19532213940e..aac556e2c68d9 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -1250,6 +1250,9 @@ Checking if a module can be imported
If you need to find out if a module can be imported without actually doing the
import, then you should use :func:`importlib.util.find_spec`.
+
+Note that if ``name`` is a submodule (contains a dot),
+:func:`importlib.util.find_spec` will import the parent module.
::
import importlib.util
More information about the Python-checkins
mailing list