Skip to content

Commit 867d16e

Browse files
authored
gh-142349: Update lazy imports C API and sys.flags documentation (#158966)
Fix lazy imports C API and sys.flags documentation
1 parent b94fdb7 commit 867d16e

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
@@ -678,6 +678,11 @@ always available. Unless explicitly noted otherwise, all variables are read-only
678678
- :option:`-X context_aware_warnings <-X>` and
679679
:envvar:`PYTHON_CONTEXT_AWARE_WARNINGS`
680680

681+
* - .. attribute:: flags.lazy_imports
682+
- :option:`-X lazy_imports <-X>` and :envvar:`PYTHON_LAZY_IMPORTS`
683+
(``1`` for ``all``, ``-1`` otherwise; not changed by
684+
:func:`set_lazy_imports`)
685+
681686

682687
.. versionchanged:: 3.2
683688
Added ``quiet`` attribute for the new :option:`-q` flag.
@@ -714,6 +719,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
714719
.. versionchanged:: 3.14
715720
Added the ``context_aware_warnings`` attribute.
716721

722+
.. versionchanged:: 3.15
723+
Added the ``lazy_imports`` attribute.
724+
717725

718726
.. data:: float_info
719727

0 commit comments

Comments
 (0)