https://github.com/python/cpython/commit/d01fec5e226674c3521e2c30a8ce5ea9328f6933
commit: d01fec5e226674c3521e2c30a8ce5ea9328f6933
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2026-11-04T02:46:57Z
summary:

[3.15] gh-155273: Document `PyConfig.lazy_imports` (GH-155281) (GH-161297)

(cherry picked from commit be581b5dc52b277e00a0e9dff3e442436eb69ce8)

Co-authored-by: Vyron Vasileiadis <[email protected]>

files:
M Doc/c-api/init_config.rst

diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst
index 9304ad24107792..ab5ffc9d100aef 100644
--- a/Doc/c-api/init_config.rst
+++ b/Doc/c-api/init_config.rst
@@ -390,6 +390,10 @@ Configuration Options
      - :c:member:`isolated <PyConfig.isolated>`
      - ``bool``
      - Read-only
+   * - ``"lazy_imports"``
+     - :c:member:`lazy_imports <PyConfig.lazy_imports>`
+     - ``int``
+     - Public
    * - ``"legacy_windows_fs_encoding"``
      - :c:member:`legacy_windows_fs_encoding 
<PyPreConfig.legacy_windows_fs_encoding>`
      - ``bool``
@@ -1590,6 +1594,21 @@ PyConfig
       See also the :ref:`Isolated Configuration <init-isolated-conf>` and
       :c:member:`PyPreConfig.isolated`.
 
+   .. c:member:: int lazy_imports
+
+      Control :ref:`lazy imports <lazy-imports>`.
+
+      A value of ``-1`` keeps the default behaviour, where only imports marked
+      with the ``lazy`` keyword are lazy. A value of ``1`` makes every import
+      lazy. ``0`` is rejected.
+
+      Configured by the :option:`-X lazy_imports <-X>` command line option or
+      the :envvar:`PYTHON_LAZY_IMPORTS` environment variable.
+
+      Default: ``-1``.
+
+      .. versionadded:: 3.15
+
    .. c:member:: int legacy_windows_stdio
 
       If non-zero, use :class:`io.FileIO` instead of

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to