Skip to content

Commit 1c0c429

Browse files
gh-155273: Document PyConfig.lazy_imports in C API config docs
1 parent fe3a123 commit 1c0c429

1 file changed

Lines changed: 26 additions & 4 deletions

File tree

Doc/c-api/init_config.rst

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,14 @@ Configuration Options
373373
- :c:member:`install_signal_handlers <PyConfig.install_signal_handlers>`
374374
- ``bool``
375375
- Read-only
376-
* - ``"int_max_str_digits"``
377-
- :c:member:`int_max_str_digits <PyConfig.int_max_str_digits>`
378-
- ``int``
379-
- Public
376+
* - ``"int_max_str_digits"``
377+
- :c:member:`int_max_str_digits <PyConfig.int_max_str_digits>`
378+
- ``int``
379+
- Public
380+
* - ``"lazy_imports"``
381+
- :c:member:`lazy_imports <PyConfig.lazy_imports>`
382+
- ``int``
383+
- Public
380384
* - ``"interactive"``
381385
- :c:member:`interactive <PyConfig.interactive>`
382386
- ``bool``
@@ -1543,6 +1547,24 @@ PyConfig
15431547
15441548
.. versionadded:: 3.12
15451549
1550+
.. c:member:: int lazy_imports
1551+
1552+
Controls the global lazy imports mode.
1553+
1554+
* ``-1``: ``"normal"`` - only imports explicitly marked with the ``lazy``
1555+
keyword are lazy (the default).
1556+
* ``1``: ``"all"`` - all top-level imports become potentially lazy.
1557+
* ``0``: rejected; not a valid value.
1558+
1559+
Configured by the :option:`-X lazy_imports <-X>` command line flag or
1560+
the :envvar:`PYTHON_LAZY_IMPORTS` environment variable.
1561+
1562+
See also :func:`sys.set_lazy_imports` and :pep:`810`.
1563+
1564+
Default: ``-1``.
1565+
1566+
.. versionadded:: 3.15
1567+
15461568
.. c:member:: int cpu_count
15471569
15481570
If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will

0 commit comments

Comments
 (0)