cpython
cpython copied to clipboard
gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover
- Issue: gh-139899
📚 Documentation preview 📚: https://cpython-previews--139900.org.readthedocs.build/
Still needs tests, but I'll wait to see the feedback on the issue.
I've updated the method to take a module spec, instead of a module object, as in some cases the parent might have failed to import.
In a follow-up, I will add a protocol for finders implementing .discover(), as @brettcannon suggested.