mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 19:41:51 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
from _typeshed import SupportsRead, SupportsWrite
|
||||
from typing import Any, AnyStr, Callable, Iterable, List, Sequence, Set, Text, Tuple, Type, TypeVar, Union
|
||||
from typing import Any, AnyStr, Callable, Iterable, Sequence, Text, TypeVar, Union
|
||||
|
||||
_AnyStr = TypeVar("_AnyStr", str, unicode)
|
||||
_AnyPath = TypeVar("_AnyPath", str, unicode)
|
||||
_PathReturn = Type[None]
|
||||
_PathReturn = type[None]
|
||||
|
||||
class Error(EnvironmentError): ...
|
||||
class SpecialFileError(EnvironmentError): ...
|
||||
@@ -15,9 +15,9 @@ def copymode(src: Text, dst: Text) -> None: ...
|
||||
def copystat(src: Text, dst: Text) -> None: ...
|
||||
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 ignore_patterns(*patterns: Text) -> Callable[[Any, list[_AnyStr]], set[_AnyStr]]: ...
|
||||
def copytree(
|
||||
src: AnyStr, dst: AnyStr, symlinks: bool = ..., ignore: 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: Callable[[Any, _AnyPath, Any], Any] | None = ...) -> None: ...
|
||||
|
||||
@@ -35,11 +35,11 @@ def make_archive(
|
||||
group: str | None = ...,
|
||||
logger: Any | None = ...,
|
||||
) -> _AnyStr: ...
|
||||
def get_archive_formats() -> List[Tuple[str, str]]: ...
|
||||
def get_archive_formats() -> list[tuple[str, str]]: ...
|
||||
def register_archive_format(
|
||||
name: str,
|
||||
function: Callable[..., Any],
|
||||
extra_args: Sequence[Tuple[str, Any] | List[Any]] | None = ...,
|
||||
extra_args: Sequence[tuple[str, Any] | list[Any]] | None = ...,
|
||||
description: str = ...,
|
||||
) -> None: ...
|
||||
def unregister_archive_format(name: str) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user