Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -1,5 +1,5 @@
from _typeshed import SupportsRead, SupportsWrite
from typing import Any, AnyStr, Callable, Iterable, List, Optional, Sequence, Set, Text, Tuple, Type, TypeVar, Union
from typing import Any, AnyStr, Callable, Iterable, List, Sequence, Set, Text, Tuple, Type, TypeVar, Union
_AnyStr = TypeVar("_AnyStr", str, unicode)
_AnyPath = TypeVar("_AnyPath", str, unicode)
@@ -17,9 +17,9 @@ def copy(src: Text, dst: Text) -> _PathReturn: ...
def copy2(src: Text, dst: Text) -> _PathReturn: ...
def ignore_patterns(*patterns: Text) -> Callable[[Any, List[_AnyStr]], Set[_AnyStr]]: ...
def copytree(
src: AnyStr, dst: AnyStr, symlinks: bool = ..., ignore: Union[None, Callable[[AnyStr, List[AnyStr]], Iterable[AnyStr]]] = ...
src: AnyStr, dst: AnyStr, symlinks: bool = ..., ignore: None | Callable[[AnyStr, List[AnyStr]], Iterable[AnyStr]] = ...
) -> _PathReturn: ...
def rmtree(path: _AnyPath, ignore_errors: bool = ..., onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ...) -> None: ...
def rmtree(path: _AnyPath, ignore_errors: bool = ..., onerror: Callable[[Any, _AnyPath, Any], Any] | None = ...) -> None: ...
_CopyFn = Union[Callable[[str, str], None], Callable[[Text, Text], None]]
@@ -27,19 +27,19 @@ def move(src: Text, dst: Text) -> _PathReturn: ...
def make_archive(
base_name: _AnyStr,
format: str,
root_dir: Optional[Text] = ...,
base_dir: Optional[Text] = ...,
root_dir: Text | None = ...,
base_dir: Text | None = ...,
verbose: bool = ...,
dry_run: bool = ...,
owner: Optional[str] = ...,
group: Optional[str] = ...,
logger: Optional[Any] = ...,
owner: str | None = ...,
group: str | None = ...,
logger: Any | None = ...,
) -> _AnyStr: ...
def get_archive_formats() -> List[Tuple[str, str]]: ...
def register_archive_format(
name: str,
function: Callable[..., Any],
extra_args: Optional[Sequence[Union[Tuple[str, Any], List[Any]]]] = ...,
extra_args: Sequence[Tuple[str, Any] | List[Any]] | None = ...,
description: str = ...,
) -> None: ...
def unregister_archive_format(name: str) -> None: ...