]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-92994: Clarify importlib "check" example (GH-92995)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 23 May 2022 02:11:58 +0000 (19:11 -0700)
committerGitHub <noreply@github.com>
Mon, 23 May 2022 02:11:58 +0000 (19:11 -0700)
Fixes GH-92994
(cherry picked from commit e39cd765610c9099da3b5595186ad16223b670b0)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Doc/library/importlib.rst

index c9fb63b75a4718b161a7ef5bd0f41fd2a5398f0f..85c23472e27560444663664a6e66a07df31a2ceb 100644 (file)
@@ -1749,6 +1749,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