@@ -346,6 +346,58 @@ Importing Modules
346346
347347 .. versionadded :: 3.14
348348
349+ .. c :function :: PyImport_LazyImportsMode PyImport_GetLazyImportsMode ()
350+
351+ Gets the current lazy imports mode.
352+
353+ .. versionadded:: next
354+
355+ .. c:function:: PyObject* PyImport_GetLazyImportsFilter()
356+
357+ Return a :term:`strong reference` to the current lazy imports filter,
358+ or ``NULL`` if none exists. This function always succeeds.
359+
360+ .. versionadded:: next
361+
362+ .. c:function:: int PyImport_SetLazyImportsMode(PyImport_LazyImportsMode mode)
363+
364+ Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded
365+ strings instead of Python :class:`str` objects.
366+
367+ This function always returns ``0``.
368+
369+ .. versionadded:: next
370+
371+ .. c:function:: int PyImport_SetLazyImportsFilter(PyObject *filter)
372+
373+ Sets the current lazy imports filter. The *filter * should be a callable that
374+ will receive ``(importing_module_name, imported_module_name, [fromlist]) ``
375+ when an import can potentially be lazy and that must return ``True `` if
376+ the import should be lazy and ``False `` otherwise.
377+
378+ Return ``0 `` on success and ``-1 `` with an exception set otherwise.
379+
380+ .. versionadded :: next
381+
382+ .. c :type :: PyImport_LazyImportsMode
383+
384+ Enumeration of possible lazy import modes.
385+
386+ .. c :enumerator :: PyImport_LAZY_NORMAL
387+
388+ Respect the ``lazy `` keyword in source code. This is the default mode.
389+
390+ .. c :enumerator :: PyImport_LAZY_ALL
391+
392+ Make all imports lazy by default.
393+
394+ .. c :enumerator :: PyImport_LAZY_NONE
395+
396+ Disable lazy imports entirely. Even explicit ``lazy `` statements become
397+ eager imports.
398+
399+ .. versionadded :: next
400+
349401.. c :function :: PyObject* PyImport_CreateModuleFromInitfunc (PyObject *spec, PyObject * (*initfunc)(void))
350402
351403 This function is a building block that enables embedders to implement
0 commit comments