]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-92994: Clarify importlib "check" example (#92995)
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>
Mon, 23 May 2022 01:53:24 +0000 (18:53 -0700)
committerGitHub <noreply@github.com>
Mon, 23 May 2022 01:53:24 +0000 (18:53 -0700)
Fixes #92994

Doc/library/importlib.rst

index f19532213940e253ae6471d6496dbd68e18abc9f..aac556e2c68d94024c252399d46b41da6ef0319b 100644 (file)
@@ -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