diff --git a/stdlib/3/pathlib.pyi b/stdlib/3/pathlib.pyi index 42968fa98..fb06c65e0 100644 --- a/stdlib/3/pathlib.pyi +++ b/stdlib/3/pathlib.pyi @@ -30,7 +30,10 @@ class PurePath(_PurePathBase): def __le__(self, other: PurePath) -> bool: ... def __gt__(self, other: PurePath) -> bool: ... def __ge__(self, other: PurePath) -> bool: ... - def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3, 6): + def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + else: + def __truediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... if sys.version_info < (3,): def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... def __bytes__(self) -> bytes: ... @@ -39,10 +42,16 @@ class PurePath(_PurePathBase): def is_absolute(self) -> bool: ... def is_reserved(self) -> bool: ... def match(self, path_pattern: str) -> bool: ... - def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3, 6): + def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + else: + def relative_to(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... def with_name(self: _P, name: str) -> _P: ... def with_suffix(self: _P, suffix: str) -> _P: ... - def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3, 6): + def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + else: + def joinpath(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... @property def parents(self: _P) -> Sequence[_P]: ... diff --git a/third_party/2/pathlib2.pyi b/third_party/2/pathlib2.pyi index 42968fa98..fb06c65e0 100644 --- a/third_party/2/pathlib2.pyi +++ b/third_party/2/pathlib2.pyi @@ -30,7 +30,10 @@ class PurePath(_PurePathBase): def __le__(self, other: PurePath) -> bool: ... def __gt__(self, other: PurePath) -> bool: ... def __ge__(self, other: PurePath) -> bool: ... - def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3, 6): + def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + else: + def __truediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... if sys.version_info < (3,): def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... def __bytes__(self) -> bytes: ... @@ -39,10 +42,16 @@ class PurePath(_PurePathBase): def is_absolute(self) -> bool: ... def is_reserved(self) -> bool: ... def match(self, path_pattern: str) -> bool: ... - def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3, 6): + def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + else: + def relative_to(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... def with_name(self: _P, name: str) -> _P: ... def with_suffix(self: _P, suffix: str) -> _P: ... - def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3, 6): + def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + else: + def joinpath(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... @property def parents(self: _P) -> Sequence[_P]: ...