From 1c0c42931cc4ce4b570a6ff52ffedfb83d17d1d0 Mon Sep 17 00:00:00 2001 From: Senthilnathan Date: Thu, 6 Aug 2026 17:40:53 +0530 Subject: [PATCH] gh-155273: Document PyConfig.lazy_imports in C API config docs --- Doc/c-api/init_config.rst | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index ef09639189a6c27..825ed13ef2b19bb 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -373,10 +373,14 @@ Configuration Options - :c:member:`install_signal_handlers ` - ``bool`` - Read-only - * - ``"int_max_str_digits"`` - - :c:member:`int_max_str_digits ` - - ``int`` - - Public + * - ``"int_max_str_digits"`` + - :c:member:`int_max_str_digits ` + - ``int`` + - Public + * - ``"lazy_imports"`` + - :c:member:`lazy_imports ` + - ``int`` + - Public * - ``"interactive"`` - :c:member:`interactive ` - ``bool`` @@ -1543,6 +1547,24 @@ PyConfig .. versionadded:: 3.12 + .. c:member:: int lazy_imports + + Controls the global lazy imports mode. + + * ``-1``: ``"normal"`` - only imports explicitly marked with the ``lazy`` + keyword are lazy (the default). + * ``1``: ``"all"`` - all top-level imports become potentially lazy. + * ``0``: rejected; not a valid value. + + Configured by the :option:`-X lazy_imports <-X>` command line flag or + the :envvar:`PYTHON_LAZY_IMPORTS` environment variable. + + See also :func:`sys.set_lazy_imports` and :pep:`810`. + + Default: ``-1``. + + .. versionadded:: 3.15 + .. c:member:: int cpu_count If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will