Skip to content

Commit 6866a56

Browse files
fedonmanmiss-islington
authored andcommitted
gh-155273: Document PyConfig.lazy_imports (GH-155281)
(cherry picked from commit be581b5) Co-authored-by: Vyron Vasileiadis <hi@fedonman.com>
1 parent 37f4276 commit 6866a56

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
@@ -385,6 +385,10 @@ Configuration Options
385385
- :c:member:`isolated <PyConfig.isolated>`
386386
- ``bool``
387387
- Read-only
388+
* - ``"lazy_imports"``
389+
- :c:member:`lazy_imports <PyConfig.lazy_imports>`
390+
- ``int``
391+
- Public
388392
* - ``"legacy_windows_fs_encoding"``
389393
- :c:member:`legacy_windows_fs_encoding <PyPreConfig.legacy_windows_fs_encoding>`
390394
- ``bool``
@@ -1582,6 +1586,21 @@ PyConfig
15821586
See also the :ref:`Isolated Configuration <init-isolated-conf>` and
15831587
:c:member:`PyPreConfig.isolated`.
15841588
1589+
.. c:member:: int lazy_imports
1590+
1591+
Control :ref:`lazy imports <lazy-imports>`.
1592+
1593+
A value of ``-1`` keeps the default behaviour, where only imports marked
1594+
with the ``lazy`` keyword are lazy. A value of ``1`` makes every import
1595+
lazy. ``0`` is rejected.
1596+
1597+
Configured by the :option:`-X lazy_imports <-X>` command line option or
1598+
the :envvar:`PYTHON_LAZY_IMPORTS` environment variable.
1599+
1600+
Default: ``-1``.
1601+
1602+
.. versionadded:: 3.15
1603+
15851604
.. c:member:: int legacy_windows_stdio
15861605
15871606
If non-zero, use :class:`io.FileIO` instead of

0 commit comments

Comments
 (0)