PurePath methods accept os.PathLike[str] from 3.6 (#3099)

Closes #3095
This commit is contained in:
Francis Colas
2019-07-02 13:08:32 +02:00
committed by Sebastian Rittau
parent 668d050476
commit 75d9228b02
2 changed files with 24 additions and 6 deletions

View File

@@ -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]: ...