Skip to content

Commit 6fc7d09

Browse files
committed
Fix lazy imports C API and sys.flags documentation
Replace the PyImport_SetLazyImportsMode() description, which was copied from PyImport_ImportModuleAttrString(), and document the sys.flags.lazy_imports attribute.
1 parent 182f323 commit 6fc7d09

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
@@ -366,8 +366,7 @@ Importing Modules
366366
367367
.. c:function:: int PyImport_SetLazyImportsMode(PyImport_LazyImportsMode mode)
368368
369-
Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded
370-
strings instead of Python :class:`str` objects.
369+
Sets the current lazy imports mode.
371370
372371
This function always returns ``0``.
373372

‎Doc/library/sys.rst‎

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

658+
* - .. attribute:: flags.lazy_imports
659+
- :option:`-X lazy_imports <-X>` and :envvar:`PYTHON_LAZY_IMPORTS`
660+
(``1`` for ``all``, ``-1`` otherwise; not changed by
661+
:func:`set_lazy_imports`)
662+
658663

659664
.. versionchanged:: 3.2
660665
Added ``quiet`` attribute for the new :option:`-q` flag.
@@ -691,6 +696,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
691696
.. versionchanged:: 3.14
692697
Added the ``context_aware_warnings`` attribute.
693698

699+
.. versionchanged:: 3.15
700+
Added the ``lazy_imports`` attribute.
701+
694702

695703
.. data:: float_info
696704

0 commit comments

Comments
 (0)