I canât reproduce any meaningful Python-specific differences.
$ python3.8
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'importlib' has no attribute 'util'
>>> import importlib.util
>>>
$ python3.11
Python 3.11.2 (main, Apr 5 2023, 03:08:14) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'importlib' has no attribute 'util'
>>> import importlib.util
>>>
$ python3.12
Python 3.12.2 (main, Mar 29 2024, 00:26:08) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'importlib' has no attribute 'util'
>>> import importlib.util
>>>
$ python3.8
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkgutil
>>> importlib.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'importlib' is not defined
>>> import importlib
>>> importlib.util
<module 'importlib.util' from '/usr/lib/python3.8/importlib/util.py'>
>>>
$ python3.11
Python 3.11.2 (main, Apr 5 2023, 03:08:14) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkgutil
>>> importlib.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'importlib' is not defined
>>> import importlib
>>> importlib.util
<module 'importlib.util' (frozen)>
>>>
$ python3.12
Python 3.12.2 (main, Mar 29 2024, 00:26:08) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkgutil
>>> importlib.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'importlib' is not defined. Did you forget to import 'importlib'?
>>> import importlib
>>> importlib.util
<module 'importlib.util' (frozen)>
>>>
The fact that an imported module is âfrozenâ is not really relevant here; itâs an implementation detail and doesnât change how you use it.