File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -873,6 +873,7 @@ determine dynamically the modules to be loaded.
873873
874874
875875.. _lazy-imports :
876+ .. _lazy :
876877
877878Lazy 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,
885890the import becomes *lazy *: the module is not loaded immediately at the import
886891statement. Instead, a lazy proxy object is created and bound to the name. The
887892actual 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-
895894Lazy imports are only permitted at module scope. Using ``lazy `` inside a
896895function, class body, or :keyword: `try `/:keyword: `except `/:keyword: `finally `
897896block raises a :exc: `SyntaxError `. Star imports cannot be lazy (``lazy from
You can’t perform that action at this time.
0 commit comments