From e4fdd0eb628269eb34decadb3f44a7a18d353e04 Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Mon, 13 Mar 2017 18:35:50 +0300 Subject: [PATCH] Update stubs for `pathlib.PurePath` and `pathlib.Path` classes due to PEP-519. --- stdlib/3.4/pathlib.pyi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/stdlib/3.4/pathlib.pyi b/stdlib/3.4/pathlib.pyi index ef142a7c7..796bce01c 100644 --- a/stdlib/3.4/pathlib.pyi +++ b/stdlib/3.4/pathlib.pyi @@ -22,8 +22,10 @@ class PurePath(_PurePathBase): stem = ... # type: str if sys.version_info < (3, 5): def __init__(self, *pathsegments: str) -> None: ... - else: + elif sys.version_info < (3, 6): def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike]) -> _P: ... def __hash__(self) -> int: ... def __lt__(self, other: PurePath) -> bool: ... def __le__(self, other: PurePath) -> bool: ... @@ -93,8 +95,12 @@ class Path(PurePath): if sys.version_info >= (3, 5): @classmethod def home(cls: Type[_P]) -> _P: ... - def __new__(cls: Type[_P], *args: Union[str, PurePath], - **kwargs: Any) -> _P: ... + if sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath], + **kwargs: Any) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike], + **kwargs: Any) -> _P: ... def absolute(self: _P) -> _P: ... def expanduser(self: _P) -> _P: ...