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,21 +1,5 @@
import sys
from typing import (
IO,
Any,
Callable,
Dict,
Generator,
Iterable,
List,
NoReturn,
Pattern,
Protocol,
Sequence,
Tuple,
Type,
TypeVar,
overload,
)
from typing import IO, Any, Callable, Generator, Iterable, NoReturn, Pattern, Protocol, Sequence, Tuple, Type, TypeVar, overload
_T = TypeVar("_T")
_ActionT = TypeVar("_ActionT", bound=Action)
@@ -36,8 +20,8 @@ class ArgumentError(Exception):
# undocumented
class _AttributeHolder:
def _get_kwargs(self) -> List[Tuple[str, Any]]: ...
def _get_args(self) -> List[Any]: ...
def _get_kwargs(self) -> list[Tuple[str, Any]]: ...
def _get_args(self) -> list[Any]: ...
# undocumented
class _ActionsContainer:
@@ -46,14 +30,14 @@ class _ActionsContainer:
argument_default: Any
conflict_handler: str
_registries: Dict[str, Dict[Any, Any]]
_actions: List[Action]
_option_string_actions: Dict[str, Action]
_action_groups: List[_ArgumentGroup]
_mutually_exclusive_groups: List[_MutuallyExclusiveGroup]
_defaults: Dict[str, Any]
_registries: dict[str, dict[Any, Any]]
_actions: list[Action]
_option_string_actions: dict[str, Action]
_action_groups: list[_ArgumentGroup]
_mutually_exclusive_groups: list[_MutuallyExclusiveGroup]
_defaults: dict[str, Any]
_negative_number_matcher: Pattern[str]
_has_negative_number_optionals: List[bool]
_has_negative_number_optionals: list[bool]
def __init__(self, description: str | None, prefix_chars: str, argument_default: Any, conflict_handler: str) -> None: ...
def register(self, registry_name: str, value: Any, object: Any) -> None: ...
def _registry_get(self, registry_name: str, value: Any, default: Any = ...) -> Any: ...
@@ -80,8 +64,8 @@ class _ActionsContainer:
def _add_action(self, action: _ActionT) -> _ActionT: ...
def _remove_action(self, action: Action) -> None: ...
def _add_container_actions(self, container: _ActionsContainer) -> None: ...
def _get_positional_kwargs(self, dest: str, **kwargs: Any) -> Dict[str, Any]: ...
def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ...
def _get_positional_kwargs(self, dest: str, **kwargs: Any) -> dict[str, Any]: ...
def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> dict[str, Any]: ...
def _pop_action_class(self, kwargs: Any, default: Type[Action] | None = ...) -> Type[Action]: ...
def _get_handler(self) -> Callable[[Action, Iterable[Tuple[str, Action]]], Any]: ...
def _check_conflict(self, action: Action) -> None: ...
@@ -185,26 +169,26 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def format_help(self) -> str: ...
def parse_known_args(
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
) -> Tuple[Namespace, List[str]]: ...
def convert_arg_line_to_args(self, arg_line: str) -> List[str]: ...
) -> Tuple[Namespace, list[str]]: ...
def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ...
def exit(self, status: int = ..., message: str | None = ...) -> NoReturn: ...
def error(self, message: str) -> NoReturn: ...
if sys.version_info >= (3, 7):
def parse_intermixed_args(self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...) -> Namespace: ...
def parse_known_intermixed_args(
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
) -> Tuple[Namespace, List[str]]: ...
) -> Tuple[Namespace, list[str]]: ...
# undocumented
def _get_optional_actions(self) -> List[Action]: ...
def _get_positional_actions(self) -> List[Action]: ...
def _parse_known_args(self, arg_strings: List[str], namespace: Namespace) -> Tuple[Namespace, List[str]]: ...
def _read_args_from_files(self, arg_strings: List[str]) -> List[str]: ...
def _get_optional_actions(self) -> list[Action]: ...
def _get_positional_actions(self) -> list[Action]: ...
def _parse_known_args(self, arg_strings: list[str], namespace: Namespace) -> Tuple[Namespace, list[str]]: ...
def _read_args_from_files(self, arg_strings: list[str]) -> list[str]: ...
def _match_argument(self, action: Action, arg_strings_pattern: str) -> int: ...
def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> List[int]: ...
def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> list[int]: ...
def _parse_optional(self, arg_string: str) -> Tuple[Action | None, str, str | None] | None: ...
def _get_option_tuples(self, option_string: str) -> List[Tuple[Action, str, str | None]]: ...
def _get_option_tuples(self, option_string: str) -> list[Tuple[Action, str, str | None]]: ...
def _get_nargs_pattern(self, action: Action) -> str: ...
def _get_values(self, action: Action, arg_strings: List[str]) -> Any: ...
def _get_values(self, action: Action, arg_strings: list[str]) -> Any: ...
def _get_value(self, action: Action, arg_string: str) -> Any: ...
def _check_value(self, action: Action, value: Any) -> None: ...
def _get_formatter(self) -> HelpFormatter: ...
@@ -249,7 +233,7 @@ class HelpFormatter:
def _format_args(self, action: Action, default_metavar: str) -> str: ...
def _expand_help(self, action: Action) -> str: ...
def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ...
def _split_lines(self, text: str, width: int) -> List[str]: ...
def _split_lines(self, text: str, width: int) -> list[str]: ...
def _fill_text(self, text: str, width: int, indent: str) -> str: ...
def _get_help_string(self, action: Action) -> str | None: ...
def _get_default_metavar_for_optional(self, action: Action) -> str: ...
@@ -322,7 +306,7 @@ class FileType:
# undocumented
class _ArgumentGroup(_ActionsContainer):
title: str | None
_group_actions: List[Action]
_group_actions: list[Action]
def __init__(
self, container: _ActionsContainer, title: str | None = ..., description: str | None = ..., **kwargs: Any
) -> None: ...
@@ -399,9 +383,9 @@ class _SubParsersAction(Action):
_ChoicesPseudoAction: Type[Any] # nested class
_prog_prefix: str
_parser_class: Type[ArgumentParser]
_name_parser_map: Dict[str, ArgumentParser]
choices: Dict[str, ArgumentParser]
_choices_actions: List[Action]
_name_parser_map: dict[str, ArgumentParser]
choices: dict[str, ArgumentParser]
_choices_actions: list[Action]
if sys.version_info >= (3, 7):
def __init__(
self,
@@ -425,7 +409,7 @@ class _SubParsersAction(Action):
) -> None: ...
# TODO: Type keyword args properly.
def add_parser(self, name: str, **kwargs: Any) -> ArgumentParser: ...
def _get_subactions(self) -> List[Action]: ...
def _get_subactions(self) -> list[Action]: ...
# undocumented
class ArgumentTypeError(Exception): ...