Skip to content

Commit 917b92e

Browse files
committed
More doc fixes
1 parent 610af78 commit 917b92e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Doc/reference/simple_stmts.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ determine dynamically the modules to be loaded.
873873

874874

875875
.. _lazy-imports:
876+
.. _lazy:
876877

877878
Lazy imports
878879
------------
@@ -881,17 +882,15 @@ Lazy imports
881882
pair: lazy; import
882883
single: lazy import
883884

884-
When an import statement is preceded by the :keyword:`lazy<lazy import>` keyword,
885+
The :keyword:`lazy` keyword marks an import as lazy. It is a :ref:`soft keyword
886+
<soft-keywords>` that only has special meaning when it appears immediately
887+
before an :keyword:`import` or :keyword:`from` statement.
888+
889+
When an import statement is preceded by the :keyword:`lazy` keyword,
885890
the import becomes *lazy*: the module is not loaded immediately at the import
886891
statement. Instead, a lazy proxy object is created and bound to the name. The
887892
actual module is loaded on first use of that name.
888893

889-
.. keyword:: lazy import
890-
891-
The ``lazy`` keyword marks an import as lazy. It is a :ref:`soft keyword
892-
<soft-keywords>` that only has special meaning when it appears immediately
893-
before an :keyword:`import` or :keyword:`from` statement.
894-
895894
Lazy imports are only permitted at module scope. Using ``lazy`` inside a
896895
function, class body, or :keyword:`try`/:keyword:`except`/:keyword:`finally`
897896
block raises a :exc:`SyntaxError`. Star imports cannot be lazy (``lazy from

0 commit comments

Comments
 (0)