We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a64ccd6 commit 9d27502Copy full SHA for 9d27502
Doc/library/importlib.rst
@@ -210,6 +210,12 @@ Functions
210
:exc:`ModuleNotFoundError` is raised when the module being reloaded lacks
211
a :class:`~importlib.machinery.ModuleSpec`.
212
213
+ .. versionchanged:: 3.14
214
+ If *module* is a lazy module that has not yet been materialized (i.e.,
215
+ loaded via :class:`importlib.util.LazyLoader` and not yet accessed),
216
+ calling :func:`reload` is a no-op and returns the module unchanged.
217
+ This prevents the reload from unintentionally triggering the lazy load.
218
+
219
.. warning::
220
This function is not thread-safe. Calling it from multiple threads can result
221
in unexpected behavior. It's recommended to use the :class:`threading.Lock`
0 commit comments