Big diff: use lower-case list and dict (#5888)

This commit is contained in:
Akuli
2021-08-08 19:26:35 +03:00
committed by GitHub
parent 11f54c3407
commit ce11072dbe
325 changed files with 2196 additions and 2334 deletions

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, AnyStr, Callable, Dict, Iterable, List, Mapping, Sequence, Tuple, Type, overload
from typing import IO, Any, AnyStr, Callable, Iterable, Mapping, Sequence, Tuple, Type, overload
NO_DEFAULT: Tuple[str, ...]
SUPPRESS_HELP: str
@@ -38,7 +38,7 @@ class HelpFormatter:
indent_increment: int
level: int
max_help_position: int
option_strings: Dict[Option, str]
option_strings: dict[Option, str]
parser: OptionParser
short_first: Any
width: int
@@ -74,15 +74,15 @@ class TitledHelpFormatter(HelpFormatter):
class Option:
ACTIONS: Tuple[str, ...]
ALWAYS_TYPED_ACTIONS: Tuple[str, ...]
ATTRS: List[str]
CHECK_METHODS: List[Callable[..., Any]] | None
ATTRS: list[str]
CHECK_METHODS: list[Callable[..., Any]] | None
CONST_ACTIONS: Tuple[str, ...]
STORE_ACTIONS: Tuple[str, ...]
TYPED_ACTIONS: Tuple[str, ...]
TYPES: Tuple[str, ...]
TYPE_CHECKER: Dict[str, Callable[..., Any]]
_long_opts: List[str]
_short_opts: List[str]
TYPE_CHECKER: dict[str, Callable[..., Any]]
_long_opts: list[str]
_short_opts: list[str]
action: str
dest: str | None
default: Any
@@ -90,7 +90,7 @@ class Option:
type: Any
callback: Callable[..., Any] | None
callback_args: Tuple[Any, ...] | None
callback_kwargs: Dict[str, Any] | None
callback_kwargs: dict[str, Any] | None
help: str | None
metavar: str | None
def __init__(self, *opts: str | None, **attrs: Any) -> None: ...
@@ -100,9 +100,9 @@ class Option:
def _check_const(self) -> None: ...
def _check_dest(self) -> None: ...
def _check_nargs(self) -> None: ...
def _check_opt_strings(self, opts: Iterable[str | None]) -> List[str]: ...
def _check_opt_strings(self, opts: Iterable[str | None]) -> list[str]: ...
def _check_type(self) -> None: ...
def _set_attrs(self, attrs: Dict[str, Any]) -> None: ...
def _set_attrs(self, attrs: dict[str, Any]) -> None: ...
def _set_opt_strings(self, opts: Iterable[str]) -> None: ...
def check_value(self, opt: str, value: Any) -> Any: ...
def convert_value(self, opt: str, value: Any) -> Any: ...
@@ -114,10 +114,10 @@ class Option:
make_option = Option
class OptionContainer:
_long_opt: Dict[str, Option]
_short_opt: Dict[str, Option]
_long_opt: dict[str, Option]
_short_opt: dict[str, Option]
conflict_handler: str
defaults: Dict[str, Any]
defaults: dict[str, Any]
description: Any
option_class: Type[Option]
def __init__(self, option_class: Type[Option], conflict_handler: Any, description: Any) -> None: ...
@@ -141,7 +141,7 @@ class OptionContainer:
def set_description(self, description: Any) -> None: ...
class OptionGroup(OptionContainer):
option_list: List[Option]
option_list: list[Option]
parser: OptionParser
title: str
def __init__(self, parser: OptionParser, title: str, description: str | None = ...) -> None: ...
@@ -163,13 +163,13 @@ class OptionParser(OptionContainer):
allow_interspersed_args: bool
epilog: str | None
formatter: HelpFormatter
largs: List[str] | None
option_groups: List[OptionGroup]
option_list: List[Option]
largs: list[str] | None
option_groups: list[OptionGroup]
option_list: list[Option]
process_default_values: Any
prog: str | None
rargs: List[Any] | None
standard_option_list: List[Option]
rargs: list[Any] | None
standard_option_list: list[Option]
usage: str | None
values: Values | None
version: str
@@ -189,19 +189,19 @@ class OptionParser(OptionContainer):
def _add_help_option(self) -> None: ...
def _add_version_option(self) -> None: ...
def _create_option_list(self) -> None: ...
def _get_all_options(self) -> List[Option]: ...
def _get_args(self, args: Iterable[Any]) -> List[Any]: ...
def _get_all_options(self) -> list[Option]: ...
def _get_args(self, args: Iterable[Any]) -> list[Any]: ...
def _init_parsing_state(self) -> None: ...
def _match_long_opt(self, opt: str) -> str: ...
def _populate_option_list(self, option_list: Iterable[Option], add_help: bool = ...) -> None: ...
def _process_args(self, largs: List[Any], rargs: List[Any], values: Values) -> None: ...
def _process_long_opt(self, rargs: List[Any], values: Any) -> None: ...
def _process_short_opts(self, rargs: List[Any], values: Any) -> None: ...
def _process_args(self, largs: list[Any], rargs: list[Any], values: Values) -> None: ...
def _process_long_opt(self, rargs: list[Any], values: Any) -> None: ...
def _process_short_opts(self, rargs: list[Any], values: Any) -> None: ...
@overload
def add_option_group(self, __opt_group: OptionGroup) -> OptionGroup: ...
@overload
def add_option_group(self, *args: Any, **kwargs: Any) -> OptionGroup: ...
def check_values(self, values: Values, args: List[str]) -> Tuple[Values, List[str]]: ...
def check_values(self, values: Values, args: list[str]) -> Tuple[Values, list[str]]: ...
def disable_interspersed_args(self) -> None: ...
def enable_interspersed_args(self) -> None: ...
def error(self, msg: str) -> None: ...
@@ -215,7 +215,7 @@ class OptionParser(OptionContainer):
def get_prog_name(self) -> str: ...
def get_usage(self) -> str: ...
def get_version(self) -> str: ...
def parse_args(self, args: Sequence[AnyStr] | None = ..., values: Values | None = ...) -> Tuple[Values, List[AnyStr]]: ...
def parse_args(self, args: Sequence[AnyStr] | None = ..., values: Values | None = ...) -> Tuple[Values, list[AnyStr]]: ...
def print_usage(self, file: IO[str] | None = ...) -> None: ...
def print_help(self, file: IO[str] | None = ...) -> None: ...
def print_version(self, file: IO[str] | None = ...) -> None: ...