You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
APIs related to importlib.abc.PathEntryFinder should use protocol instead #11541
Although importlib.abc.PathEntryFinder is defined as an abstract class in the standard library, path entry finders are intentionally loosely defined in the Python docs (and originated PEPs), so that the only thing that needs to be implemented is one method (find_spec). This matches the functioning of a protocol.
The reason why the abstract class is defined is probably informational (for documentation purposes) + extra code re-use internally in the stdlib. This situation is similar to importlib.abc.MetaPathFinder, and other importlib.abc classes (like loaders).
Activity