Skip to content

Commit 033e5d1

Browse files
max-muotoAkuli
andauthored
Add pathlib.Path 3.14 methods (#12487)
Co-authored-by: Akuli <[email protected]>
1 parent 442c7d3 commit 033e5d1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

stdlib/pathlib.pyi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,20 @@ class Path(PurePath):
159159
def lchmod(self, mode: int) -> None: ...
160160
def lstat(self) -> stat_result: ...
161161
def mkdir(self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False) -> None: ...
162+
163+
if sys.version_info >= (3, 14):
164+
def copy(self, target: StrPath, *, follow_symlinks: bool = True, preserve_metadata: bool = False) -> None: ...
165+
def copytree(
166+
self,
167+
target: StrPath,
168+
*,
169+
follow_symlinks: bool = True,
170+
preserve_metadata: bool = False,
171+
dirs_exist_ok: bool = False,
172+
ignore: Callable[[Self], bool] | None = None,
173+
on_error: Callable[[OSError], object] | None = None,
174+
) -> None: ...
175+
162176
# Adapted from builtins.open
163177
# Text mode: always returns a TextIOWrapper
164178
# The Traversable .open in stdlib/importlib/abc.pyi should be kept in sync with this.
@@ -241,6 +255,9 @@ class Path(PurePath):
241255

242256
def resolve(self, strict: bool = False) -> Self: ...
243257
def rmdir(self) -> None: ...
258+
if sys.version_info >= (3, 14):
259+
def delete(self, ignore_errors: bool = False, on_error: Callable[[OSError], object] | None = None) -> None: ...
260+
244261
def symlink_to(self, target: StrOrBytesPath, target_is_directory: bool = False) -> None: ...
245262
if sys.version_info >= (3, 10):
246263
def hardlink_to(self, target: StrOrBytesPath) -> None: ...

0 commit comments

Comments
 (0)