Reduce use of deprecated typing aliases (#6358)

This commit is contained in:
Alex Waygood
2021-11-23 09:56:43 +00:00
committed by GitHub
parent 7e836db2f3
commit c685c2d6c6
19 changed files with 64 additions and 61 deletions

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, ContextManager, Iterable, Mapping, NoReturn, Optional, Sequence, Set, Tuple, TypeVar, Union
from typing import Any, Callable, ContextManager, Iterable, Mapping, NoReturn, Optional, Sequence, Tuple, TypeVar, Union
from click.formatting import HelpFormatter
from click.parser import OptionParser
@@ -125,7 +125,7 @@ class Command(BaseCommand):
def get_params(self, ctx: Context) -> list[Parameter]: ...
def format_usage(self, ctx: Context, formatter: HelpFormatter) -> None: ...
def collect_usage_pieces(self, ctx: Context) -> list[str]: ...
def get_help_option_names(self, ctx: Context) -> Set[str]: ...
def get_help_option_names(self, ctx: Context) -> set[str]: ...
def get_help_option(self, ctx: Context) -> Option | None: ...
def make_parser(self, ctx: Context) -> OptionParser: ...
def get_short_help_str(self, limit: int = ...) -> str: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Iterable, Set, Tuple
from typing import Any, Iterable, Tuple
from click.core import Context
@@ -13,7 +13,7 @@ class Option:
nargs: int
const: Any
obj: Any
prefixes: Set[str]
prefixes: set[str]
_short_opts: list[str]
_long_opts: list[str]
def __init__(
@@ -49,7 +49,7 @@ class OptionParser:
ignore_unknown_options: bool
_short_opt: dict[str, Option]
_long_opt: dict[str, Option]
_opt_prefixes: Set[str]
_opt_prefixes: set[str]
_args: list[Argument]
def __init__(self, ctx: Context | None = ...) -> None: ...
def add_option(