Skip to content

Commit a217380

Browse files
committed
gh-158597: Clarify declaration locations for direct lazy bindings
1 parent deb8259 commit a217380

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Doc/whatsnew/3.15.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ In the case where loading a lazily imported module fails (for example, if
201201
the module does not exist), Python raises the exception at the point of
202202
first use rather than at import time. The traceback shows the access and the
203203
import failure. It can also identify the original import statement. Python
204-
omits this extra location when an attribute access on a package triggers a
204+
omits this extra location when a shared package lookup resolves a pending
205205
submodule import, since several declarations can refer to the same submodule.
206+
Direct lazy bindings stored in the package retain their declaration location.
206207

207208
For cases where you want to enable lazy loading globally without modifying
208209
source code, Python provides the :option:`-X lazy_imports <-X>` command-line

0 commit comments

Comments
 (0)