Skip to content

Commit d01fec5

Browse files
[3.15] gh-155273: Document PyConfig.lazy_imports (GH-155281) (GH-161297)
(cherry picked from commit be581b5) Co-authored-by: Vyron Vasileiadis <hi@fedonman.com>
1 parent 22bc41d commit d01fec5

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎Doc/c-api/init_config.rst‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ Configuration Options
390390
- :c:member:`isolated <PyConfig.isolated>`
391391
- ``bool``
392392
- Read-only
393+
* - ``"lazy_imports"``
394+
- :c:member:`lazy_imports <PyConfig.lazy_imports>`
395+
- ``int``
396+
- Public
393397
* - ``"legacy_windows_fs_encoding"``
394398
- :c:member:`legacy_windows_fs_encoding <PyPreConfig.legacy_windows_fs_encoding>`
395399
- ``bool``
@@ -1590,6 +1594,21 @@ PyConfig
15901594
See also the :ref:`Isolated Configuration <init-isolated-conf>` and
15911595
:c:member:`PyPreConfig.isolated`.
15921596
1597+
.. c:member:: int lazy_imports
1598+
1599+
Control :ref:`lazy imports <lazy-imports>`.
1600+
1601+
A value of ``-1`` keeps the default behaviour, where only imports marked
1602+
with the ``lazy`` keyword are lazy. A value of ``1`` makes every import
1603+
lazy. ``0`` is rejected.
1604+
1605+
Configured by the :option:`-X lazy_imports <-X>` command line option or
1606+
the :envvar:`PYTHON_LAZY_IMPORTS` environment variable.
1607+
1608+
Default: ``-1``.
1609+
1610+
.. versionadded:: 3.15
1611+
15931612
.. c:member:: int legacy_windows_stdio
15941613
15951614
If non-zero, use :class:`io.FileIO` instead of

0 commit comments

Comments
 (0)