Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1790,13 +1790,13 @@ always available. Unless explicitly noted otherwise, all variables are read-only
callable or ``None`` to clear the filter.

The filter function is called for every potentially lazy import to
determine whether it should actually be lazy. It must have the following
determine whether it should actually be lazy. It should have the following
signature::

def filter(importing_module: str, imported_module: str,
fromlist: tuple[str, ...] | None) -> bool

Where:
The function is called with three positional arguments:

* *importing_module* is the name of the module doing the import
* *imported_module* is the resolved name of the module being imported
Expand All @@ -1805,6 +1805,8 @@ always available. Unless explicitly noted otherwise, all variables are read-only
* *fromlist* is the tuple of names being imported (for ``from ... import``
statements), or ``None`` for regular imports

These arguments are passed positionally.

The filter should return ``True`` to allow the import to be lazy, or
``False`` to force an eager import.

Expand Down
Loading