diff --git a/stdlib/2and3/optparse.pyi b/stdlib/2and3/optparse.pyi index ed361df75..fe7f43799 100644 --- a/stdlib/2and3/optparse.pyi +++ b/stdlib/2and3/optparse.pyi @@ -1,6 +1,6 @@ # Generated by pytype, with only minor tweaks. Might be incomplete. import sys -from typing import Any, Optional, List, Callable, Tuple, Dict, Iterable, Union, Mapping, IO +from typing import Any, Callable, Dict, IO, Iterable, List, Mapping, Optional, Sequence, Tuple, Union # See https://groups.google.com/forum/#!topic/python-ideas/gA1gdj3RZ5g if sys.version_info >= (3,): @@ -27,7 +27,7 @@ class BadOptionError(OptParseError): class AmbiguousOptionError(BadOptionError): possibilities = ... # type: Iterable[_Text] - def __init__(self, opt_str: _Text, possibilities: List[_Text]) -> None: ... + def __init__(self, opt_str: _Text, possibilities: Sequence[_Text]) -> None: ... class OptionError(OptParseError): msg = ... # type: _Text @@ -136,7 +136,7 @@ class OptionContainer: def _create_option_mappings(self) -> None: ... def _share_option_mappings(self, parser: OptionParser) -> None: ... def add_option(self, *args, **kwargs) -> Any: ... - def add_options(self, option_list: List[Option]) -> None: ... + 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: ... @@ -171,7 +171,7 @@ class OptionParser(OptionContainer): values = ... # type: Any version = ... # type: _Text def __init__(self, usage: Optional[_Text] = ..., - option_list: List[Option] = ..., + option_list: Iterable[Option] = ..., option_class: Option = ..., version: Optional[_Text] = ..., conflict_handler: _Text = ..., @@ -187,8 +187,8 @@ class OptionParser(OptionContainer): def _get_args(self, args: Iterable) -> List[Any]: ... def _init_parsing_state(self) -> None: ... def _match_long_opt(self, opt: _Text) -> _Text: ... - def _populate_option_list(self, option_list: List[Option], add_help: bool = ...) -> None: ... - def _process_args(self, largs: List[_Text], rargs: List, values: Values) -> None: ... + def _populate_option_list(self, option_list: Iterable[Option], add_help: bool = ...) -> None: ... + def _process_args(self, largs: List, rargs: List, values: Values) -> None: ... def _process_long_opt(self, rargs: List, values: Any) -> None: ... def _process_short_opts(self, rargs: List, values: Any) -> None: ... def add_option_group(self, *args, **kwargs) -> OptionParser: ... @@ -206,7 +206,7 @@ class OptionParser(OptionContainer): def get_prog_name(self) -> _Text: ... def get_usage(self) -> _Text: ... def get_version(self) -> _Text: ... - def parse_args(self, args: Optional[List[_Text]] = ..., values: Optional[Values] = ...) -> Tuple[Any, ...]: ... + def parse_args(self, args: Optional[Sequence[_Text]] = ..., values: Optional[Values] = ...) -> Tuple[Any, ...]: ... def print_usage(self, file: Optional[IO[str]] = ...) -> None: ... def print_help(self, file: Optional[IO[str]] = ...) -> None: ... def print_version(self, file: Optional[IO[str]] = ...) -> None: ...