From e39cd765610c9099da3b5595186ad16223b670b0 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 22 May 2022 18:53:24 -0700 Subject: gh-92994: Clarify importlib "check" example (#92995) Fixes #92994 --- Doc/library/importlib.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index f195322..aac556e 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 -- cgit v0.12