]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover (#139900)
authorFilipe Laíns <lains@riseup.net>
Thu, 19 Feb 2026 15:25:50 +0000 (15:25 +0000)
committerGitHub <noreply@github.com>
Thu, 19 Feb 2026 15:25:50 +0000 (15:25 +0000)
commit157f271de352f16ecd052fb1fb0fcce528962407
tree49d53ebb85368a324feb7eab20f9772d958736cb
parentf1cf762ee7d52e8acb567f1817da90ed535ef419
gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover (#139900)

* gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Fix doc reference

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Remove specific doc references

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Fix docstrings

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Revert "Remove specific doc references"

This reverts commit 31d1a8f5510e0f7a53016c7120ea2e1bda46e60c.

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Fix news references

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Add docs warning

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Raise ValueError on invalid parent

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Dedupe __path__ in PathFinder.discover

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Use context manager and add error handling to os.scandir

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Raise ValueError on invalid parent

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Dedupe when package exists with multiple suffixes

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Apply suggestions from code review

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
* Add tests

Signed-off-by: Filipe Laíns <lains@riseup.net>
---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
Doc/library/importlib.rst
Lib/importlib/_bootstrap_external.py
Lib/importlib/abc.py
Lib/test/test_importlib/test_discover.py [new file with mode: 0644]
Misc/NEWS.d/next/Library/2025-10-10-14-08-58.gh-issue-139899.09leRY.rst [new file with mode: 0644]