Skip to content

Commit 909b69a

Browse files
committed
Standardize versionadded tags and minor updates to documentation
1 parent b3060f6 commit 909b69a

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

Doc/library/exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ The following exceptions are the exceptions that are usually raised.
271271
A subclass of :exc:`ImportError` which is raised when a lazy import fails
272272
because it (directly or indirectly) tries to import itself.
273273

274-
.. versionadded:: 3.15
274+
.. versionadded:: next
275275

276276
.. exception:: IndexError
277277

Doc/library/sys.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
922922

923923
See also :func:`set_lazy_imports` and :pep:`810`.
924924

925-
.. versionadded:: 3.15
925+
.. versionadded:: next
926926

927927

928928
.. function:: get_lazy_imports_filter()
@@ -934,7 +934,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
934934
whether it should actually be lazy. See :func:`set_lazy_imports_filter` for
935935
details on the filter function signature.
936936

937-
.. versionadded:: 3.15
937+
.. versionadded:: next
938938

939939

940940
.. function:: get_lazy_modules()
@@ -945,7 +945,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
945945
Note that modules are removed from this set when they are reified (actually
946946
loaded on first use).
947947

948-
.. versionadded:: 3.15
948+
.. versionadded:: next
949949

950950

951951
.. function:: getrefcount(object)
@@ -1775,7 +1775,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
17751775

17761776
See also :func:`get_lazy_imports` and :pep:`810`.
17771777

1778-
.. versionadded:: 3.15
1778+
.. versionadded:: next
17791779

17801780

17811781
.. function:: set_lazy_imports_filter(filter)
@@ -1804,7 +1804,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
18041804

18051805
See also :func:`get_lazy_imports_filter` and :pep:`810`.
18061806

1807-
.. versionadded:: 3.15
1807+
.. versionadded:: next
18081808

18091809

18101810
.. function:: setprofile(profilefunc)

Doc/whatsnew/3.15.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ at the top level but may only use a subset of them in any given run. The deferre
125125
loading reduces startup latency without requiring code restructuring or conditional
126126
imports scattered throughout the codebase.
127127

128-
When a lazy import eventually fails (for example, if the module does not exist),
129-
Python raises the exception at the point of first use rather than at import time.
130-
The traceback includes both the location where the name was accessed and the
131-
original import statement, making it straightforward to diagnose the problem.
128+
In the case where loading a lazily imported module fails (for example, if the
129+
module does not exist), Python raises the exception at the point of first use
130+
rather than at import time. The associated traceback includes both the location
131+
where the name was accessed and the original import statement, making it
132+
straightforward to diagnose & debug the failure.
132133

133134
For cases where you want to enable lazy loading globally without modifying source
134135
code, Python provides the :option:`-X lazy_imports <-X>` command-line option and
@@ -162,12 +163,12 @@ containing the names of all modules that have been lazily imported but not yet
162163
loaded. The proxy type itself is available as :data:`types.LazyImportType` for
163164
code that needs to detect lazy imports programmatically.
164165

165-
There are some restrictions on where ``lazy`` can appear. Lazy imports are only
166-
permitted at module scope; using ``lazy`` inside a function, class body, or
167-
``try``/``except``/``finally`` block raises a :exc:`SyntaxError`. Star imports
168-
cannot be lazy (``lazy from module import *`` is a syntax error), and future
169-
imports cannot be lazy either (``lazy from __future__ import ...`` raises
170-
:exc:`SyntaxError`).
166+
There are some restrictions on where the ``lazy`` keyword can be used. Lazy
167+
imports are only permitted at module scope; using ``lazy`` inside a function,
168+
class body, or ``try``/``except``/``finally`` block raises a :exc:`SyntaxError`.
169+
Star imports cannot be lazy (``lazy from module import *`` is a syntax error),
170+
and future imports cannot be lazy either (``lazy from __future__ import ...``
171+
raises :exc:`SyntaxError`).
171172

172173
.. seealso:: :pep:`810` for the full specification and rationale.
173174

0 commit comments

Comments
 (0)