File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -931,8 +931,7 @@ Compatibility mode via ``__lazy_modules__``
931931As an alternative to using the :keyword: `lazy ` keyword, a module can opt
932932into lazy loading for specific imports by defining a module-level
933933:attr: `~module.__lazy_modules__ ` variable. When present, it must be a
934- container (an object implementing :meth: `~object.__contains__ `) of fully
935- qualified module name strings. Any regular (non-``lazy ``)
934+ container of fully qualified module name strings. Any regular (non-``lazy ``)
936935:keyword: `import ` statement at module scope whose target appears in
937936:attr: `!__lazy_modules__ ` is treated as a lazy import, exactly as if the
938937:keyword: `lazy ` keyword had been used.
Original file line number Diff line number Diff line change @@ -185,8 +185,8 @@ raise :exc:`SyntaxError`).
185185For code that cannot use the ``lazy `` keyword directly (for example, when
186186supporting Python versions older than 3.15 while still leveraging lazy
187187imports on 3.15+), a module can define
188- :attr: `~module.__lazy_modules__ ` as a container (an object implementing
189- :meth: ` ~object.__contains__ `) of fully qualified module name strings. Regular ``import `` statements for those modules are then treated
188+ :attr: `~module.__lazy_modules__ ` as a container of fully qualified module
189+ name strings. Regular ``import `` statements for those modules are then treated
190190as lazy, with the same semantics as the ``lazy `` keyword::
191191
192192 __lazy_modules__ = ["json", "pathlib"]
You can’t perform that action at this time.
0 commit comments