From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Mon, 23 May 2022 01:53:24 +0000 (-0700) Subject: gh-92994: Clarify importlib "check" example (#92995) X-Git-Tag: v3.12.0a1~1464 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e39cd765610c9099da3b5595186ad16223b670b0;p=thirdparty%2FPython%2Fcpython.git gh-92994: Clarify importlib "check" example (#92995) Fixes #92994 --- diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index f19532213940..aac556e2c68d 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