mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Use lowercase type everywhere (#6853)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import IO, Any, Callable, Generator, Generic, Iterable, NoReturn, Pattern, Protocol, Sequence, Type, TypeVar, overload
|
||||
from typing import IO, Any, Callable, Generator, Generic, Iterable, NoReturn, Pattern, Protocol, Sequence, TypeVar, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_ActionT = TypeVar("_ActionT", bound=Action)
|
||||
@@ -47,7 +47,7 @@ class _ActionsContainer:
|
||||
def add_argument(
|
||||
self,
|
||||
*name_or_flags: str,
|
||||
action: str | Type[Action] = ...,
|
||||
action: str | type[Action] = ...,
|
||||
nargs: int | str = ...,
|
||||
const: Any = ...,
|
||||
default: Any = ...,
|
||||
@@ -67,7 +67,7 @@ class _ActionsContainer:
|
||||
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 _pop_action_class(self, kwargs: Any, default: Type[Action] | None = ...) -> Type[Action]: ...
|
||||
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: ...
|
||||
def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> NoReturn: ...
|
||||
@@ -143,7 +143,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
action: Type[Action] = ...,
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
required: bool = ...,
|
||||
@@ -157,8 +157,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
parser_class: Type[_ArgumentParserT] = ...,
|
||||
action: Type[Action] = ...,
|
||||
parser_class: type[_ArgumentParserT] = ...,
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
required: bool = ...,
|
||||
@@ -173,7 +173,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
action: Type[Action] = ...,
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
help: str | None = ...,
|
||||
@@ -186,8 +186,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
parser_class: Type[_ArgumentParserT] = ...,
|
||||
action: Type[Action] = ...,
|
||||
parser_class: type[_ArgumentParserT] = ...,
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
help: str | None = ...,
|
||||
@@ -237,7 +237,7 @@ class HelpFormatter:
|
||||
_current_section: Any
|
||||
_whitespace_matcher: Pattern[str]
|
||||
_long_break_matcher: Pattern[str]
|
||||
_Section: Type[Any] # Nested class
|
||||
_Section: type[Any] # Nested class
|
||||
def __init__(self, prog: str, indent_increment: int = ..., max_help_position: int = ..., width: int | None = ...) -> None: ...
|
||||
def _indent(self) -> None: ...
|
||||
def _dedent(self) -> None: ...
|
||||
@@ -410,9 +410,9 @@ class _VersionAction(Action):
|
||||
|
||||
# undocumented
|
||||
class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
_ChoicesPseudoAction: Type[Any] # nested class
|
||||
_ChoicesPseudoAction: type[Any] # nested class
|
||||
_prog_prefix: str
|
||||
_parser_class: Type[_ArgumentParserT]
|
||||
_parser_class: type[_ArgumentParserT]
|
||||
_name_parser_map: dict[str, _ArgumentParserT]
|
||||
choices: dict[str, _ArgumentParserT]
|
||||
_choices_actions: list[Action]
|
||||
@@ -421,7 +421,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
self,
|
||||
option_strings: Sequence[str],
|
||||
prog: str,
|
||||
parser_class: Type[_ArgumentParserT],
|
||||
parser_class: type[_ArgumentParserT],
|
||||
dest: str = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
@@ -432,7 +432,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
self,
|
||||
option_strings: Sequence[str],
|
||||
prog: str,
|
||||
parser_class: Type[_ArgumentParserT],
|
||||
parser_class: type[_ArgumentParserT],
|
||||
dest: str = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
|
||||
Reference in New Issue
Block a user