Skip to content

Commit 1a03d13

Browse files
authored
Merge pull request #149 from encukou/docs/lazy-imports-audit-20261121
2 parents bd6342a + a103890 commit 1a03d13

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

‎Doc/library/sys.rst‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
954954
:attr:`module.__lazy_modules__`. This is the default mode.
955955
* ``"all"``: Make all eligible module-scope imports potentially lazy.
956956

957-
See also :func:`set_lazy_imports` and :pep:`810`.
957+
See also :func:`set_lazy_imports` and :ref:`lazy-imports`.
958958

959959
.. versionadded:: 3.15
960960

@@ -1538,7 +1538,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
15381538
In future versions of Python, these may be removed, and/or additional
15391539
extras may be added.
15401540

1541-
See also :func:`set_lazy_imports` and :pep:`810`.
1541+
See also :func:`set_lazy_imports` and :ref:`lazy-imports`.
15421542

15431543
.. versionadded:: 3.15
15441544

@@ -1848,7 +1848,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
18481848
In addition to the mode, lazy imports can be controlled via the filter
18491849
provided by :func:`set_lazy_imports_filter`.
18501850

1851-
See also :func:`get_lazy_imports` and :pep:`810`.
1851+
See also :func:`get_lazy_imports` and :ref:`lazy-imports`.
18521852

18531853
.. versionadded:: 3.15
18541854

@@ -1885,7 +1885,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
18851885
This is an advanced feature intended for specialized users who need
18861886
fine-grained control over lazy import behavior.
18871887

1888-
See also :func:`get_lazy_imports_filter` and :pep:`810`.
1888+
See also :func:`get_lazy_imports_filter` and :ref:`lazy-imports`.
18891889

18901890
.. versionadded:: 3.15
18911891

‎Doc/library/types.rst‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ Standard names are defined for the following types:
362362

363363
.. versionadded:: 3.15
364364

365-
.. seealso:: :pep:`810`
365+
.. seealso:: :ref:`lazy-imports`
366366

367367
.. method:: resolve()
368368

@@ -373,6 +373,10 @@ Standard names are defined for the following types:
373373
lazy import json
374374
json = globals()["json"].resolve()
375375

376+
Each call to :func:`!resolve` call does a fresh import.
377+
The proxy itself does not store :func:`!resolve`'s result,
378+
relying on the import mechanism to use :attr:`sys.modules`
379+
to reuse modules that have already been imported.
376380

377381
.. class:: GetSetDescriptorType
378382

‎Doc/reference/simple_stmts.rst‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,9 @@ If an error occurs during module loading (such as :exc:`ImportError` or
921921
used, not at the import statement itself.
922922

923923
The sections below describe name resolution and runtime controls.
924-
See :pep:`810` for the full specification of lazy imports.
924+
925+
.. seealso:: :pep:`810` provides the rationale and initial specification
926+
for lazy imports.
925927

926928
.. versionadded:: 3.15
927929

0 commit comments

Comments
 (0)