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

@@ -155,7 +155,7 @@ class MultiCommand(Command):
) -> None: ...
def resultcallback(self, replace: bool = ...) -> Callable[[_F], _F]: ...
def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None: ...
def resolve_command(self, ctx: Context, args: list[str]) -> Tuple[str, Command, list[str]]: ...
def resolve_command(self, ctx: Context, args: list[str]) -> tuple[str, Command, list[str]]: ...
def get_command(self, ctx: Context, cmd_name: str) -> Command | None: ...
def list_commands(self, ctx: Context) -> Iterable[str]: ...
@@ -227,8 +227,8 @@ class Parameter:
def full_process_value(self, ctx: Context, value: Any) -> Any: ...
def resolve_envvar_value(self, ctx: Context) -> str: ...
def value_from_envvar(self, ctx: Context) -> str | list[str]: ...
def handle_parse_result(self, ctx: Context, opts: dict[str, Any], args: list[str]) -> Tuple[Any, list[str]]: ...
def get_help_record(self, ctx: Context) -> Tuple[str, str]: ...
def handle_parse_result(self, ctx: Context, opts: dict[str, Any], args: list[str]) -> tuple[Any, list[str]]: ...
def get_help_record(self, ctx: Context) -> tuple[str, str]: ...
def get_usage_pieces(self, ctx: Context) -> list[str]: ...
def get_error_hint(self, ctx: Context) -> str: ...

View File

@@ -1,6 +1,6 @@
from _typeshed import IdentityFunction
from distutils.version import Version
from typing import Any, Callable, Iterable, Text, Tuple, Type, TypeVar, Union, overload
from typing import Any, Callable, Iterable, Text, Type, TypeVar, Union, overload
from click.core import Argument, Command, Context, Group, Option, Parameter, _ConvertibleType
@@ -69,7 +69,7 @@ def argument(
expose_value: bool = ...,
is_eager: bool = ...,
envvar: str | list[str] | None = ...,
autocompletion: Callable[[Context, list[str], str], Iterable[str | Tuple[str, str]]] | None = ...,
autocompletion: Callable[[Context, list[str], str], Iterable[str | tuple[str, str]]] | None = ...,
) -> IdentityFunction: ...
@overload
def option(

View File

@@ -26,4 +26,4 @@ class HelpFormatter:
def indentation(self) -> ContextManager[None]: ...
def getvalue(self) -> str: ...
def join_options(options: list[str]) -> Tuple[str, bool]: ...
def join_options(options: list[str]) -> tuple[str, bool]: ...

View File

@@ -2,8 +2,8 @@ from typing import Any, Iterable, Set, Tuple
from click.core import Context
def _unpack_args(args: Iterable[str], nargs_spec: Iterable[int]) -> Tuple[Tuple[Tuple[str, ...] | None, ...], list[str]]: ...
def split_opt(opt: str) -> Tuple[str, str]: ...
def _unpack_args(args: Iterable[str], nargs_spec: Iterable[int]) -> tuple[Tuple[Tuple[str, ...] | None, ...], list[str]]: ...
def split_opt(opt: str) -> tuple[str, str]: ...
def normalize_opt(opt: str, ctx: Context) -> str: ...
def split_arg_string(string: str) -> list[str]: ...
@@ -62,4 +62,4 @@ class OptionParser:
obj: Any | None = ...,
) -> None: ...
def add_argument(self, dest: str, nargs: int = ..., obj: Any | None = ...) -> None: ...
def parse_args(self, args: list[str]) -> Tuple[dict[str, Any], list[str], list[Any]]: ...
def parse_args(self, args: list[str]) -> tuple[dict[str, Any], list[str], list[Any]]: ...

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Callable, Generator, Iterable, Text, Tuple, TypeVar, overload
from typing import IO, Any, Callable, Generator, Iterable, Text, TypeVar, overload
from click._termui_impl import ProgressBar as _ProgressBar
from click.core import _ConvertibleType
@@ -20,7 +20,7 @@ def prompt(
def confirm(
text: str, default: bool = ..., abort: bool = ..., prompt_suffix: str = ..., show_default: bool = ..., err: bool = ...
) -> bool: ...
def get_terminal_size() -> Tuple[int, int]: ...
def get_terminal_size() -> tuple[int, int]: ...
def echo_via_pager(
text_or_generator: str | Iterable[str] | Callable[[], Generator[str, None, None]], color: bool | None = ...
) -> None: ...

View File

@@ -1,5 +1,5 @@
import io
from typing import IO, Any, BinaryIO, ContextManager, Iterable, Mapping, Text, Tuple
from typing import IO, Any, BinaryIO, ContextManager, Iterable, Mapping, Text
from typing_extensions import Literal
from .core import BaseCommand
@@ -51,7 +51,7 @@ class CliRunner:
def make_env(self, overrides: Mapping[str, str] | None = ...) -> dict[str, str]: ...
def isolation(
self, input: bytes | Text | IO[Any] | None = ..., env: Mapping[str, str] | None = ..., color: bool = ...
) -> ContextManager[Tuple[io.BytesIO, io.BytesIO | Literal[False]]]: ...
) -> ContextManager[tuple[io.BytesIO, io.BytesIO | Literal[False]]]: ...
def invoke(
self,
cli: BaseCommand,