Skip to content

Use self-type for parent[s] properties too #667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions stdlib/3.5/pathlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class PurePath:
drive = ... # type: str
root = ... # type: str
anchor = ... # type: str
parents = ... # type: Sequence[PurePath]
parent = ... # type: PurePath
name = ... # type: str
suffix = ... # type: str
suffixes = ... # type: List[str]
Expand All @@ -33,6 +31,8 @@ class PurePath:
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: ...
def parents(self: _P) -> Sequence[_P]: ...
def parent(self: _P) -> _P: ...

class PurePosixPath(PurePath): ...
class PureWindowsPath(PurePath): ...
Expand Down Expand Up @@ -83,11 +83,6 @@ class Path(PurePath):
def write_text(self, data: str, encoding: Optional[str] = ...,
errors: Optional[str] = ...) -> int: ...

# The following are repeated here even though they only actually exist in the base
# class so that they return Path when used on a Path, rather than returning PurePath.
parents = ... # type: Sequence[Path]
parent = ... # type: Path


class PosixPath(Path, PurePosixPath): ...
class WindowsPath(Path, PureWindowsPath): ...