mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Use lowercase tuple where possible (#6170)
This commit is contained in:
@@ -12,7 +12,7 @@ from _typeshed import (
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from importlib.machinery import ModuleSpec
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
|
||||
from typing import IO, Any, BinaryIO, Iterator, Mapping, Protocol, Sequence, Tuple, Union, overload
|
||||
from typing import IO, Any, BinaryIO, Iterator, Mapping, Protocol, Sequence, Union, overload
|
||||
from typing_extensions import Literal, runtime_checkable
|
||||
|
||||
_Path = Union[bytes, str]
|
||||
@@ -55,7 +55,7 @@ class MetaPathFinder(Finder):
|
||||
|
||||
class PathEntryFinder(Finder):
|
||||
def find_module(self, fullname: str) -> Loader | None: ...
|
||||
def find_loader(self, fullname: str) -> Tuple[Loader | None, Sequence[_Path]]: ...
|
||||
def find_loader(self, fullname: str) -> tuple[Loader | None, Sequence[_Path]]: ...
|
||||
def invalidate_caches(self) -> None: ...
|
||||
# Not defined on the actual class, but expected to exist.
|
||||
def find_spec(self, fullname: str, target: types.ModuleType | None = ...) -> ModuleSpec | None: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import importlib.abc
|
||||
import types
|
||||
from typing import Any, Callable, Sequence, Tuple
|
||||
from typing import Any, Callable, Sequence
|
||||
|
||||
# TODO: the loaders seem a bit backwards, attribute is protocol but __init__ arg isn't?
|
||||
class ModuleSpec:
|
||||
@@ -100,10 +100,10 @@ def all_suffixes() -> list[str]: ...
|
||||
|
||||
class FileFinder(importlib.abc.PathEntryFinder):
|
||||
path: str
|
||||
def __init__(self, path: str, *loader_details: Tuple[importlib.abc.Loader, list[str]]) -> None: ...
|
||||
def __init__(self, path: str, *loader_details: tuple[importlib.abc.Loader, list[str]]) -> None: ...
|
||||
@classmethod
|
||||
def path_hook(
|
||||
cls, *loader_details: Tuple[importlib.abc.Loader, list[str]]
|
||||
cls, *loader_details: tuple[importlib.abc.Loader, list[str]]
|
||||
) -> Callable[[str], importlib.abc.PathEntryFinder]: ...
|
||||
|
||||
class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader):
|
||||
|
||||
Reference in New Issue
Block a user