Use lowercase tuple where possible (#6170)

This commit is contained in:
Akuli
2021-10-15 00:18:19 +00:00
committed by GitHub
parent 5f386b0575
commit 994b69ef8f
242 changed files with 1212 additions and 1224 deletions

View File

@@ -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: ...

View File

@@ -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):