From 6e9e059f0ce8aec103ae8ee0c11cff840d4305d3 Mon Sep 17 00:00:00 2001 From: Brian Turek Date: Wed, 22 Apr 2020 00:52:33 +0100 Subject: [PATCH] Add return type for pathlib.Path.replace on Python >= 3.8 (#3936) --- stdlib/3/pathlib.pyi | 3 ++- third_party/2/pathlib2.pyi | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stdlib/3/pathlib.pyi b/stdlib/3/pathlib.pyi index b470d1f0d..4c4f9ee72 100644 --- a/stdlib/3/pathlib.pyi +++ b/stdlib/3/pathlib.pyi @@ -99,9 +99,10 @@ class Path(PurePath): def owner(self) -> str: ... if sys.version_info >= (3, 8): def rename(self: _P, target: Union[str, PurePath]) -> _P: ... + def replace(self: _P, target: Union[str, PurePath]) -> _P: ... else: def rename(self, target: Union[str, PurePath]) -> None: ... - def replace(self, target: Union[str, PurePath]) -> None: ... + def replace(self, target: Union[str, PurePath]) -> None: ... if sys.version_info < (3, 6): def resolve(self: _P) -> _P: ... else: diff --git a/third_party/2/pathlib2.pyi b/third_party/2/pathlib2.pyi index b470d1f0d..4c4f9ee72 100644 --- a/third_party/2/pathlib2.pyi +++ b/third_party/2/pathlib2.pyi @@ -99,9 +99,10 @@ class Path(PurePath): def owner(self) -> str: ... if sys.version_info >= (3, 8): def rename(self: _P, target: Union[str, PurePath]) -> _P: ... + def replace(self: _P, target: Union[str, PurePath]) -> _P: ... else: def rename(self, target: Union[str, PurePath]) -> None: ... - def replace(self, target: Union[str, PurePath]) -> None: ... + def replace(self, target: Union[str, PurePath]) -> None: ... if sys.version_info < (3, 6): def resolve(self: _P) -> _P: ... else: