Skip to content

Commit 47ec308

Browse files
[3.15] gh-142349: Update lazy imports C API and sys.flags documentation (GH-158966) (#160110)
Co-authored-by: Brittany Reynoso <breynoso@meta.com>
1 parent ab61b4b commit 47ec308

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎Doc/c-api/import.rst‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ Importing Modules
363363
364364
.. c:function:: int PyImport_SetLazyImportsMode(PyImport_LazyImportsMode mode)
365365
366-
Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded
367-
strings instead of Python :class:`str` objects.
366+
Sets the current lazy imports mode.
368367
369368
This function always returns ``0``.
370369

‎Doc/library/sys.rst‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,11 @@ always available. Unless explicitly noted otherwise, all variables are read-only
652652
- :option:`-X context_aware_warnings <-X>` and
653653
:envvar:`PYTHON_CONTEXT_AWARE_WARNINGS`
654654

655+
* - .. attribute:: flags.lazy_imports
656+
- :option:`-X lazy_imports <-X>` and :envvar:`PYTHON_LAZY_IMPORTS`
657+
(``1`` for ``all``, ``-1`` otherwise; not changed by
658+
:func:`set_lazy_imports`)
659+
655660

656661
.. versionchanged:: 3.2
657662
Added ``quiet`` attribute for the new :option:`-q` flag.
@@ -688,6 +693,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
688693
.. versionchanged:: 3.14
689694
Added the ``context_aware_warnings`` attribute.
690695

696+
.. versionchanged:: 3.15
697+
Added the ``lazy_imports`` attribute.
698+
691699

692700
.. data:: float_info
693701

0 commit comments

Comments
 (0)