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:
Akuli
2021-05-15 15:33:39 +03:00
committed by GitHub
parent b0ef85288d
commit 17dcea4a68
106 changed files with 1539 additions and 3275 deletions

View File

@@ -1,44 +1,30 @@
import sys
from os import PathLike
from typing import Any, AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Text, Tuple, Union
if sys.version_info >= (3, 6):
from os import PathLike
if sys.version_info >= (3, 9):
from types import GenericAlias
DEFAULT_IGNORES: List[str]
if sys.version_info >= (3, 6):
def cmp(
f1: Union[bytes, Text, PathLike[AnyStr]], f2: Union[bytes, Text, PathLike[AnyStr]], shallow: Union[int, bool] = ...
) -> bool: ...
def cmpfiles(
a: Union[AnyStr, PathLike[AnyStr]],
b: Union[AnyStr, PathLike[AnyStr]],
common: Iterable[AnyStr],
shallow: Union[int, bool] = ...,
) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ...
else:
def cmp(f1: Union[bytes, Text], f2: Union[bytes, Text], shallow: Union[int, bool] = ...) -> bool: ...
def cmpfiles(
a: AnyStr, b: AnyStr, common: Iterable[AnyStr], shallow: Union[int, bool] = ...
) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ...
def cmp(
f1: Union[bytes, Text, PathLike[AnyStr]], f2: Union[bytes, Text, PathLike[AnyStr]], shallow: Union[int, bool] = ...
) -> bool: ...
def cmpfiles(
a: Union[AnyStr, PathLike[AnyStr]],
b: Union[AnyStr, PathLike[AnyStr]],
common: Iterable[AnyStr],
shallow: Union[int, bool] = ...,
) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ...
class dircmp(Generic[AnyStr]):
if sys.version_info >= (3, 6):
def __init__(
self,
a: Union[AnyStr, PathLike[AnyStr]],
b: Union[AnyStr, PathLike[AnyStr]],
ignore: Optional[Sequence[AnyStr]] = ...,
hide: Optional[Sequence[AnyStr]] = ...,
) -> None: ...
else:
def __init__(
self, a: AnyStr, b: AnyStr, ignore: Optional[Sequence[AnyStr]] = ..., hide: Optional[Sequence[AnyStr]] = ...
) -> None: ...
def __init__(
self,
a: Union[AnyStr, PathLike[AnyStr]],
b: Union[AnyStr, PathLike[AnyStr]],
ignore: Optional[Sequence[AnyStr]] = ...,
hide: Optional[Sequence[AnyStr]] = ...,
) -> None: ...
left: AnyStr
right: AnyStr
hide: Sequence[AnyStr]
@@ -69,5 +55,4 @@ class dircmp(Generic[AnyStr]):
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
if sys.version_info >= (3,):
def clear_cache() -> None: ...
def clear_cache() -> None: ...