stdlib: Apply some simple deprecations (#11044)

This commit is contained in:
Jelle Zijlstra
2023-11-23 00:03:01 -08:00
committed by GitHub
parent 42875bcbf1
commit c2c8d7cf5d
4 changed files with 105 additions and 32 deletions

View File

@@ -3,6 +3,7 @@ from _typeshed import SupportsRead
from collections.abc import Callable, Iterable, Iterator
from importlib.abc import Loader, MetaPathFinder, PathEntryFinder
from typing import IO, Any, NamedTuple, TypeVar
from typing_extensions import deprecated
__all__ = [
"get_importer",
@@ -35,8 +36,10 @@ if sys.version_info < (3, 12):
class ImpLoader:
def __init__(self, fullname: str, file: IO[str], filename: str, etc: tuple[str, str, int]) -> None: ...
@deprecated("Use importlib.util.find_spec() instead. Will be removed in Python 3.14.")
def find_loader(fullname: str) -> Loader | None: ...
def get_importer(path_item: str) -> PathEntryFinder | None: ...
@deprecated("Use importlib.util.find_spec() instead. Will be removed in Python 3.14.")
def get_loader(module_or_name: str) -> Loader | None: ...
def iter_importers(fullname: str = "") -> Iterator[MetaPathFinder | PathEntryFinder]: ...
def iter_modules(path: Iterable[str] | None = None, prefix: str = "") -> Iterator[ModuleInfo]: ...