8000 Adjust `MetaPathFinder` by layday · Pull Request #6344 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Adjust MetaPathFinder #6344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 20, 2021
Merged
Changes from 1 commit
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
Next Next commit
Remove find_module
Deprecated since 3.4 and triggers spurious errors in type checkers
when implementing a meta path finder without it.
  • Loading branch information
layday committed Nov 19, 2021
commit 13c83ed866f64b164270305aafb9081118ef333b
3 changes: 1 addition & 2 deletions stdlib/sys.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from builtins import object as _object
from importlib.abc import Loader, PathEntryFinder
from importlib.abc import PathEntryFinder
from importlib.machinery import ModuleSpec
from io import TextIOWrapper
from types import FrameType, ModuleType, TracebackType
Expand Down Expand Up @@ -31,7 +31,6 @@ _PathSequence = Sequence[Union[bytes, str]]

# Unlike importlib.abc.MetaPathFinder, invalidate_caches() might not exist (see python docs)
class _MetaPathFinder(Protocol):
def find_module(self, fullname: str, path: _PathSequence | None) -> Loader | None: ...
def find_spec(self, fullname: str, path: _PathSequence | None, target: ModuleType | None = ...) -> ModuleSpec | None: ...

# ----- sys variables -----
Expand Down
0