Closed
Description
The example at https://docs.python.org/3/library/importlib.html#checking-if-a-module-can-be-imported is misleading:
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 importlib.util.find_spec().
But importlib.util.find_spec
will import parent modules if a submodule is provided https://docs.python.org/3/library/importlib.html#importlib.util.find_spec
If name is for a submodule (contains a dot), the parent module is automatically imported.
Users reading this example probably do not expect anything to get imported at all