Introduce _typeshed.GenericPath and _typeshed.AnyStr_co (#7970)

This commit is contained in:
Alex Waygood
2022-05-27 19:02:00 +01:00
committed by GitHub
parent f52da1e8b0
commit ceccc655db
6 changed files with 44 additions and 47 deletions

View File

@@ -1,7 +1,6 @@
import sys
from _typeshed import StrOrBytesPath
from _typeshed import GenericPath, StrOrBytesPath
from collections.abc import Callable, Iterable, Sequence
from os import PathLike
from typing import Any, AnyStr, Generic
from typing_extensions import Literal
@@ -15,17 +14,14 @@ BUFSIZE: Literal[8192]
def cmp(f1: StrOrBytesPath, f2: StrOrBytesPath, shallow: bool | Literal[0, 1] = ...) -> bool: ...
def cmpfiles(
a: AnyStr | PathLike[AnyStr],
b: AnyStr | PathLike[AnyStr],
common: Iterable[AnyStr | PathLike[AnyStr]],
shallow: bool | Literal[0, 1] = ...,
a: GenericPath[AnyStr], b: GenericPath[AnyStr], common: Iterable[GenericPath[AnyStr]], shallow: bool | Literal[0, 1] = ...
) -> tuple[list[AnyStr], list[AnyStr], list[AnyStr]]: ...
class dircmp(Generic[AnyStr]):
def __init__(
self,
a: AnyStr | PathLike[AnyStr],
b: AnyStr | PathLike[AnyStr],
a: GenericPath[AnyStr],
b: GenericPath[AnyStr],
ignore: Sequence[AnyStr] | None = ...,
hide: Sequence[AnyStr] | None = ...,
) -> None: ...