https://github.com/python/cpython/commit/867d16eb02a55e57f895b6fd44913748c0619268
commit: 867d16eb02a55e57f895b6fd44913748c0619268
branch: main
author: Brittany Reynoso <[email protected]>
committer: DinoV <[email protected]>
date: 2026-10-21T12:53:51-07:00
summary:
gh-142349: Update lazy imports C API and sys.flags documentation (#158966)
Fix lazy imports C API and sys.flags documentation
files:
M Doc/c-api/import.rst
M Doc/library/sys.rst
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst
index 2eb8a45d299bc6..11e795a8016a3c 100644
--- a/Doc/c-api/import.rst
+++ b/Doc/c-api/import.rst
@@ -363,8 +363,7 @@ Importing Modules
.. c:function:: int PyImport_SetLazyImportsMode(PyImport_LazyImportsMode mode)
- Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded
- strings instead of Python :class:`str` objects.
+ Sets the current lazy imports mode.
This function always returns ``0``.
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index aa13a9225d6748..305881a2e591d3 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -678,6 +678,11 @@ always available. Unless explicitly noted otherwise, all
variables are read-only
- :option:`-X context_aware_warnings <-X>` and
:envvar:`PYTHON_CONTEXT_AWARE_WARNINGS`
+ * - .. attribute:: flags.lazy_imports
+ - :option:`-X lazy_imports <-X>` and :envvar:`PYTHON_LAZY_IMPORTS`
+ (``1`` for ``all``, ``-1`` otherwise; not changed by
+ :func:`set_lazy_imports`)
+
.. versionchanged:: 3.2
Added ``quiet`` attribute for the new :option:`-q` flag.
@@ -714,6 +719,9 @@ always available. Unless explicitly noted otherwise, all
variables are read-only
.. versionchanged:: 3.14
Added the ``context_aware_warnings`` attribute.
+ .. versionchanged:: 3.15
+ Added the ``lazy_imports`` attribute.
+
.. data:: float_info
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]