Skip to content
Merged
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
gh-142349: Clarify lazy import filters have positional-only parameters (
GH-144856)

(cherry picked from commit 66eb823)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
  • Loading branch information
johnslavik authored and miss-islington committed Jul 28, 2026
commit 1da9ec64978938ee75ef34bb0d9b5a97753b18b4
4 changes: 2 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 Down
Loading