mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)
* run script and do some manual changes (Akuli) * do the whole thing manually (srittau) * merge changes (Akuli) Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
@@ -24,10 +24,7 @@ _T = TypeVar("_T")
|
||||
_ActionT = TypeVar("_ActionT", bound=Action)
|
||||
_N = TypeVar("_N")
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
_Text = str
|
||||
else:
|
||||
_Text = Union[str, unicode]
|
||||
_Text = str
|
||||
|
||||
ONE_OR_MORE: str
|
||||
OPTIONAL: str
|
||||
@@ -108,9 +105,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
formatter_class: _FormatterClass
|
||||
fromfile_prefix_chars: Optional[_Text]
|
||||
add_help: bool
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
allow_abbrev: bool
|
||||
allow_abbrev: bool
|
||||
|
||||
# undocumented
|
||||
_positionals: _ArgumentGroup
|
||||
@@ -134,7 +129,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
allow_abbrev: bool = ...,
|
||||
exit_on_error: bool = ...,
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 5):
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
prog: Optional[str] = ...,
|
||||
@@ -150,21 +145,6 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
add_help: bool = ...,
|
||||
allow_abbrev: bool = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
prog: Optional[Text] = ...,
|
||||
usage: Optional[Text] = ...,
|
||||
description: Optional[Text] = ...,
|
||||
epilog: Optional[Text] = ...,
|
||||
parents: Sequence[ArgumentParser] = ...,
|
||||
formatter_class: _FormatterClass = ...,
|
||||
prefix_chars: Text = ...,
|
||||
fromfile_prefix_chars: Optional[Text] = ...,
|
||||
argument_default: Any = ...,
|
||||
conflict_handler: Text = ...,
|
||||
add_help: bool = ...,
|
||||
) -> None: ...
|
||||
# The type-ignores in these overloads should be temporary. See:
|
||||
# https://github.com/python/typeshed/pull/2643#issuecomment-442280277
|
||||
@overload
|
||||
@@ -289,9 +269,7 @@ class HelpFormatter:
|
||||
class RawDescriptionHelpFormatter(HelpFormatter): ...
|
||||
class RawTextHelpFormatter(RawDescriptionHelpFormatter): ...
|
||||
class ArgumentDefaultsHelpFormatter(HelpFormatter): ...
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
class MetavarTypeHelpFormatter(HelpFormatter): ...
|
||||
class MetavarTypeHelpFormatter(HelpFormatter): ...
|
||||
|
||||
class Action(_AttributeHolder):
|
||||
option_strings: Sequence[_Text]
|
||||
@@ -351,14 +329,11 @@ class FileType:
|
||||
# undocumented
|
||||
_mode: _Text
|
||||
_bufsize: int
|
||||
if sys.version_info >= (3,):
|
||||
_encoding: Optional[str]
|
||||
_errors: Optional[str]
|
||||
def __init__(
|
||||
self, mode: str = ..., bufsize: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, mode: Text = ..., bufsize: Optional[int] = ...) -> None: ...
|
||||
_encoding: Optional[str]
|
||||
_errors: Optional[str]
|
||||
def __init__(
|
||||
self, mode: str = ..., bufsize: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def __call__(self, string: Text) -> IO[Any]: ...
|
||||
|
||||
# undocumented
|
||||
|
||||
Reference in New Issue
Block a user