Skip to content

Commit be581b5

Browse files
authored
gh-155273: Document PyConfig.lazy_imports (GH-155281)
1 parent 6d69297 commit be581b5

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``
@@ -1599,6 +1603,21 @@ PyConfig
15991603
See also the :ref:`Isolated Configuration <init-isolated-conf>` and
16001604
:c:member:`PyPreConfig.isolated`.
16011605
1606+
.. c:member:: int lazy_imports
1607+
1608+
Control :ref:`lazy imports <lazy-imports>`.
1609+
1610+
A value of ``-1`` keeps the default behaviour, where only imports marked
1611+
with the ``lazy`` keyword are lazy. A value of ``1`` makes every import
1612+
lazy. ``0`` is rejected.
1613+
1614+
Configured by the :option:`-X lazy_imports <-X>` command line option or
1615+
the :envvar:`PYTHON_LAZY_IMPORTS` environment variable.
1616+
1617+
Default: ``-1``.
1618+
1619+
.. versionadded:: 3.15
1620+
16021621
.. c:member:: int legacy_windows_stdio
16031622
16041623
If non-zero, use :class:`io.FileIO` instead of

0 commit comments

Comments
 (0)