FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-142349: Clarify that sys.lazy_modules may contain extra items by encukou · Pull Request #155547 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
21 changes: 17 additions & 4 deletions Doc/library/sys.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1485,11 +1485,24 @@ always available. Unless explicitly noted otherwise, all variables are read-only
.. data:: lazy_modules

A :class:`set` of fully qualified module name strings that have been lazily
imported in the current interpreter but not yet loaded. When a
lazily imported module is accessed for the first time, its name is removed
from this set.
imported in the current interpreter but not yet loaded.
When a lazily imported module is accessed for the first time, its name is
typically removed from this set.

This attribute is intended for debugging and introspection.
The set may contain some additional strings.
It is intended for debugging and introspection, and consumers are expected
to verify each entry's status.

.. impl-detail::

Currently, :data:`!lazy_modules` may also contain:

* names of *attributes* (non-modules), such as ``"pathlib.Path"`` after
running ``lazy from pathlib import Path``, and
* names of items than have already been accessed.

In future versions of Python, these may be removed, and/or additional
extras may be added.

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

Expand Down
Loading

Back | FazBrowse Home | New Git URL