mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-16 03:24:54 +08:00
Remove compatibility aliases (#5464)
* Remove compatibility aliases Remove a few instances of Text Use aliases from _typeshed * Remove unused imports
This commit is contained in:
@@ -1,124 +1,123 @@
|
||||
from typing import IO, Any, AnyStr, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Type, overload
|
||||
|
||||
_Text = str
|
||||
NO_DEFAULT: Tuple[_Text, ...]
|
||||
SUPPRESS_HELP: _Text
|
||||
SUPPRESS_USAGE: _Text
|
||||
NO_DEFAULT: Tuple[str, ...]
|
||||
SUPPRESS_HELP: str
|
||||
SUPPRESS_USAGE: str
|
||||
|
||||
def check_builtin(option: Option, opt: Any, value: _Text) -> Any: ...
|
||||
def check_choice(option: Option, opt: Any, value: _Text) -> Any: ...
|
||||
def check_builtin(option: Option, opt: Any, value: str) -> Any: ...
|
||||
def check_choice(option: Option, opt: Any, value: str) -> Any: ...
|
||||
|
||||
class OptParseError(Exception):
|
||||
msg: _Text
|
||||
def __init__(self, msg: _Text) -> None: ...
|
||||
msg: str
|
||||
def __init__(self, msg: str) -> None: ...
|
||||
|
||||
class BadOptionError(OptParseError):
|
||||
opt_str: _Text
|
||||
def __init__(self, opt_str: _Text) -> None: ...
|
||||
opt_str: str
|
||||
def __init__(self, opt_str: str) -> None: ...
|
||||
|
||||
class AmbiguousOptionError(BadOptionError):
|
||||
possibilities: Iterable[_Text]
|
||||
def __init__(self, opt_str: _Text, possibilities: Sequence[_Text]) -> None: ...
|
||||
possibilities: Iterable[str]
|
||||
def __init__(self, opt_str: str, possibilities: Sequence[str]) -> None: ...
|
||||
|
||||
class OptionError(OptParseError):
|
||||
msg: _Text
|
||||
option_id: _Text
|
||||
def __init__(self, msg: _Text, option: Option) -> None: ...
|
||||
msg: str
|
||||
option_id: str
|
||||
def __init__(self, msg: str, option: Option) -> None: ...
|
||||
|
||||
class OptionConflictError(OptionError): ...
|
||||
class OptionValueError(OptParseError): ...
|
||||
|
||||
class HelpFormatter:
|
||||
NO_DEFAULT_VALUE: _Text
|
||||
_long_opt_fmt: _Text
|
||||
_short_opt_fmt: _Text
|
||||
NO_DEFAULT_VALUE: str
|
||||
_long_opt_fmt: str
|
||||
_short_opt_fmt: str
|
||||
current_indent: int
|
||||
default_tag: _Text
|
||||
default_tag: str
|
||||
help_position: Any
|
||||
help_width: Any
|
||||
indent_increment: int
|
||||
level: int
|
||||
max_help_position: int
|
||||
option_strings: Dict[Option, _Text]
|
||||
option_strings: Dict[Option, str]
|
||||
parser: OptionParser
|
||||
short_first: Any
|
||||
width: int
|
||||
def __init__(self, indent_increment: int, max_help_position: int, width: Optional[int], short_first: int) -> None: ...
|
||||
def dedent(self) -> None: ...
|
||||
def expand_default(self, option: Option) -> _Text: ...
|
||||
def format_description(self, description: _Text) -> _Text: ...
|
||||
def format_epilog(self, epilog: _Text) -> _Text: ...
|
||||
def format_heading(self, heading: Any) -> _Text: ...
|
||||
def format_option(self, option: Option) -> _Text: ...
|
||||
def format_option_strings(self, option: Option) -> _Text: ...
|
||||
def format_usage(self, usage: Any) -> _Text: ...
|
||||
def expand_default(self, option: Option) -> str: ...
|
||||
def format_description(self, description: str) -> str: ...
|
||||
def format_epilog(self, epilog: str) -> str: ...
|
||||
def format_heading(self, heading: Any) -> str: ...
|
||||
def format_option(self, option: Option) -> str: ...
|
||||
def format_option_strings(self, option: Option) -> str: ...
|
||||
def format_usage(self, usage: Any) -> str: ...
|
||||
def indent(self) -> None: ...
|
||||
def set_long_opt_delimiter(self, delim: _Text) -> None: ...
|
||||
def set_long_opt_delimiter(self, delim: str) -> None: ...
|
||||
def set_parser(self, parser: OptionParser) -> None: ...
|
||||
def set_short_opt_delimiter(self, delim: _Text) -> None: ...
|
||||
def set_short_opt_delimiter(self, delim: str) -> None: ...
|
||||
def store_option_strings(self, parser: OptionParser) -> None: ...
|
||||
|
||||
class IndentedHelpFormatter(HelpFormatter):
|
||||
def __init__(
|
||||
self, indent_increment: int = ..., max_help_position: int = ..., width: Optional[int] = ..., short_first: int = ...
|
||||
) -> None: ...
|
||||
def format_heading(self, heading: _Text) -> _Text: ...
|
||||
def format_usage(self, usage: _Text) -> _Text: ...
|
||||
def format_heading(self, heading: str) -> str: ...
|
||||
def format_usage(self, usage: str) -> str: ...
|
||||
|
||||
class TitledHelpFormatter(HelpFormatter):
|
||||
def __init__(
|
||||
self, indent_increment: int = ..., max_help_position: int = ..., width: Optional[int] = ..., short_first: int = ...
|
||||
) -> None: ...
|
||||
def format_heading(self, heading: _Text) -> _Text: ...
|
||||
def format_usage(self, usage: _Text) -> _Text: ...
|
||||
def format_heading(self, heading: str) -> str: ...
|
||||
def format_usage(self, usage: str) -> str: ...
|
||||
|
||||
class Option:
|
||||
ACTIONS: Tuple[_Text, ...]
|
||||
ALWAYS_TYPED_ACTIONS: Tuple[_Text, ...]
|
||||
ATTRS: List[_Text]
|
||||
ACTIONS: Tuple[str, ...]
|
||||
ALWAYS_TYPED_ACTIONS: Tuple[str, ...]
|
||||
ATTRS: List[str]
|
||||
CHECK_METHODS: Optional[List[Callable[..., Any]]]
|
||||
CONST_ACTIONS: Tuple[_Text, ...]
|
||||
STORE_ACTIONS: Tuple[_Text, ...]
|
||||
TYPED_ACTIONS: Tuple[_Text, ...]
|
||||
TYPES: Tuple[_Text, ...]
|
||||
TYPE_CHECKER: Dict[_Text, Callable[..., Any]]
|
||||
_long_opts: List[_Text]
|
||||
_short_opts: List[_Text]
|
||||
action: _Text
|
||||
dest: Optional[_Text]
|
||||
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]
|
||||
action: str
|
||||
dest: Optional[str]
|
||||
default: Any
|
||||
nargs: int
|
||||
type: Any
|
||||
callback: Optional[Callable[..., Any]]
|
||||
callback_args: Optional[Tuple[Any, ...]]
|
||||
callback_kwargs: Optional[Dict[_Text, Any]]
|
||||
help: Optional[_Text]
|
||||
metavar: Optional[_Text]
|
||||
def __init__(self, *opts: Optional[_Text], **attrs: Any) -> None: ...
|
||||
callback_kwargs: Optional[Dict[str, Any]]
|
||||
help: Optional[str]
|
||||
metavar: Optional[str]
|
||||
def __init__(self, *opts: Optional[str], **attrs: Any) -> None: ...
|
||||
def _check_action(self) -> None: ...
|
||||
def _check_callback(self) -> None: ...
|
||||
def _check_choice(self) -> None: ...
|
||||
def _check_const(self) -> None: ...
|
||||
def _check_dest(self) -> None: ...
|
||||
def _check_nargs(self) -> None: ...
|
||||
def _check_opt_strings(self, opts: Iterable[Optional[_Text]]) -> List[_Text]: ...
|
||||
def _check_opt_strings(self, opts: Iterable[Optional[str]]) -> List[str]: ...
|
||||
def _check_type(self) -> None: ...
|
||||
def _set_attrs(self, attrs: Dict[_Text, Any]) -> None: ...
|
||||
def _set_opt_strings(self, opts: Iterable[_Text]) -> None: ...
|
||||
def check_value(self, opt: _Text, value: Any) -> Any: ...
|
||||
def convert_value(self, opt: _Text, value: Any) -> Any: ...
|
||||
def get_opt_string(self) -> _Text: ...
|
||||
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: ...
|
||||
def get_opt_string(self) -> str: ...
|
||||
def process(self, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ...
|
||||
def take_action(self, action: _Text, dest: _Text, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ...
|
||||
def take_action(self, action: str, dest: str, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ...
|
||||
def takes_value(self) -> bool: ...
|
||||
|
||||
make_option = Option
|
||||
|
||||
class OptionContainer:
|
||||
_long_opt: Dict[_Text, Option]
|
||||
_short_opt: Dict[_Text, Option]
|
||||
conflict_handler: _Text
|
||||
defaults: Dict[_Text, Any]
|
||||
_long_opt: Dict[str, Option]
|
||||
_short_opt: Dict[str, Option]
|
||||
conflict_handler: str
|
||||
defaults: Dict[str, Any]
|
||||
description: Any
|
||||
option_class: Type[Option]
|
||||
def __init__(self, option_class: Type[Option], conflict_handler: Any, description: Any) -> None: ...
|
||||
@@ -128,64 +127,64 @@ class OptionContainer:
|
||||
@overload
|
||||
def add_option(self, opt: Option) -> Option: ...
|
||||
@overload
|
||||
def add_option(self, *args: Optional[_Text], **kwargs: Any) -> Any: ...
|
||||
def add_option(self, *args: Optional[str], **kwargs: Any) -> Any: ...
|
||||
def add_options(self, option_list: Iterable[Option]) -> None: ...
|
||||
def destroy(self) -> None: ...
|
||||
def format_description(self, formatter: Optional[HelpFormatter]) -> Any: ...
|
||||
def format_help(self, formatter: Optional[HelpFormatter]) -> _Text: ...
|
||||
def format_option_help(self, formatter: Optional[HelpFormatter]) -> _Text: ...
|
||||
def format_help(self, formatter: Optional[HelpFormatter]) -> str: ...
|
||||
def format_option_help(self, formatter: Optional[HelpFormatter]) -> str: ...
|
||||
def get_description(self) -> Any: ...
|
||||
def get_option(self, opt_str: _Text) -> Optional[Option]: ...
|
||||
def has_option(self, opt_str: _Text) -> bool: ...
|
||||
def remove_option(self, opt_str: _Text) -> None: ...
|
||||
def get_option(self, opt_str: str) -> Optional[Option]: ...
|
||||
def has_option(self, opt_str: str) -> bool: ...
|
||||
def remove_option(self, opt_str: str) -> None: ...
|
||||
def set_conflict_handler(self, handler: Any) -> None: ...
|
||||
def set_description(self, description: Any) -> None: ...
|
||||
|
||||
class OptionGroup(OptionContainer):
|
||||
option_list: List[Option]
|
||||
parser: OptionParser
|
||||
title: _Text
|
||||
def __init__(self, parser: OptionParser, title: _Text, description: Optional[_Text] = ...) -> None: ...
|
||||
title: str
|
||||
def __init__(self, parser: OptionParser, title: str, description: Optional[str] = ...) -> None: ...
|
||||
def _create_option_list(self) -> None: ...
|
||||
def set_title(self, title: _Text) -> None: ...
|
||||
def set_title(self, title: str) -> None: ...
|
||||
|
||||
class Values:
|
||||
def __init__(self, defaults: Optional[Mapping[str, Any]] = ...) -> None: ...
|
||||
def _update(self, dict: Mapping[_Text, Any], mode: Any) -> None: ...
|
||||
def _update_careful(self, dict: Mapping[_Text, Any]) -> None: ...
|
||||
def _update_loose(self, dict: Mapping[_Text, Any]) -> None: ...
|
||||
def ensure_value(self, attr: _Text, value: Any) -> Any: ...
|
||||
def read_file(self, filename: _Text, mode: _Text = ...) -> None: ...
|
||||
def read_module(self, modname: _Text, mode: _Text = ...) -> None: ...
|
||||
def _update(self, dict: Mapping[str, Any], mode: Any) -> None: ...
|
||||
def _update_careful(self, dict: Mapping[str, Any]) -> None: ...
|
||||
def _update_loose(self, dict: Mapping[str, Any]) -> None: ...
|
||||
def ensure_value(self, attr: str, value: Any) -> Any: ...
|
||||
def read_file(self, filename: str, mode: str = ...) -> None: ...
|
||||
def read_module(self, modname: str, mode: str = ...) -> None: ...
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
|
||||
class OptionParser(OptionContainer):
|
||||
allow_interspersed_args: bool
|
||||
epilog: Optional[_Text]
|
||||
epilog: Optional[str]
|
||||
formatter: HelpFormatter
|
||||
largs: Optional[List[_Text]]
|
||||
largs: Optional[List[str]]
|
||||
option_groups: List[OptionGroup]
|
||||
option_list: List[Option]
|
||||
process_default_values: Any
|
||||
prog: Optional[_Text]
|
||||
prog: Optional[str]
|
||||
rargs: Optional[List[Any]]
|
||||
standard_option_list: List[Option]
|
||||
usage: Optional[_Text]
|
||||
usage: Optional[str]
|
||||
values: Optional[Values]
|
||||
version: _Text
|
||||
version: str
|
||||
def __init__(
|
||||
self,
|
||||
usage: Optional[_Text] = ...,
|
||||
usage: Optional[str] = ...,
|
||||
option_list: Optional[Iterable[Option]] = ...,
|
||||
option_class: Type[Option] = ...,
|
||||
version: Optional[_Text] = ...,
|
||||
conflict_handler: _Text = ...,
|
||||
description: Optional[_Text] = ...,
|
||||
version: Optional[str] = ...,
|
||||
conflict_handler: str = ...,
|
||||
description: Optional[str] = ...,
|
||||
formatter: Optional[HelpFormatter] = ...,
|
||||
add_help_option: bool = ...,
|
||||
prog: Optional[_Text] = ...,
|
||||
epilog: Optional[_Text] = ...,
|
||||
prog: Optional[str] = ...,
|
||||
epilog: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def _add_help_option(self) -> None: ...
|
||||
def _add_version_option(self) -> None: ...
|
||||
@@ -193,7 +192,7 @@ class OptionParser(OptionContainer):
|
||||
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: _Text) -> _Text: ...
|
||||
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: ...
|
||||
@@ -202,20 +201,20 @@ class OptionParser(OptionContainer):
|
||||
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[_Text]) -> Tuple[Values, List[_Text]]: ...
|
||||
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: _Text) -> None: ...
|
||||
def error(self, msg: str) -> None: ...
|
||||
def exit(self, status: int = ..., msg: Optional[str] = ...) -> None: ...
|
||||
def expand_prog_name(self, s: Optional[_Text]) -> Any: ...
|
||||
def expand_prog_name(self, s: Optional[str]) -> Any: ...
|
||||
def format_epilog(self, formatter: HelpFormatter) -> Any: ...
|
||||
def format_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ...
|
||||
def format_option_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ...
|
||||
def format_help(self, formatter: Optional[HelpFormatter] = ...) -> str: ...
|
||||
def format_option_help(self, formatter: Optional[HelpFormatter] = ...) -> str: ...
|
||||
def get_default_values(self) -> Values: ...
|
||||
def get_option_group(self, opt_str: _Text) -> Any: ...
|
||||
def get_prog_name(self) -> _Text: ...
|
||||
def get_usage(self) -> _Text: ...
|
||||
def get_version(self) -> _Text: ...
|
||||
def get_option_group(self, opt_str: str) -> Any: ...
|
||||
def get_prog_name(self) -> str: ...
|
||||
def get_usage(self) -> str: ...
|
||||
def get_version(self) -> str: ...
|
||||
def parse_args(
|
||||
self, args: Optional[Sequence[AnyStr]] = ..., values: Optional[Values] = ...
|
||||
) -> Tuple[Values, List[AnyStr]]: ...
|
||||
@@ -225,4 +224,4 @@ class OptionParser(OptionContainer):
|
||||
def set_default(self, dest: Any, value: Any) -> None: ...
|
||||
def set_defaults(self, **kwargs: Any) -> None: ...
|
||||
def set_process_default_values(self, process: Any) -> None: ...
|
||||
def set_usage(self, usage: _Text) -> None: ...
|
||||
def set_usage(self, usage: str) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user