From f7d2582c9dd4c566c0359b1c4aaccd9f5b0f515b Mon Sep 17 00:00:00 2001 From: donBarbos Date: Sun, 27 Jul 2025 18:05:50 +0400 Subject: [PATCH] [pathlib] Deprecate `PurePath.is_reserved` Source: https://github.com/python/cpython/pull/95486 Docs: https://docs.python.org/3.14/library/pathlib.html#pathlib.PurePath.is_reserved --- stdlib/pathlib/__init__.pyi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stdlib/pathlib/__init__.pyi b/stdlib/pathlib/__init__.pyi index b84fc69313a1..774478bb2ff4 100644 --- a/stdlib/pathlib/__init__.pyi +++ b/stdlib/pathlib/__init__.pyi @@ -67,7 +67,14 @@ class PurePath(PathLike[str]): def as_posix(self) -> str: ... def as_uri(self) -> str: ... def is_absolute(self) -> bool: ... - def is_reserved(self) -> bool: ... + if sys.version_info >= (3, 13): + @deprecated( + "Deprecated since Python 3.13; will be removed in Python 3.15. " + "Use `os.path.isreserved()` to detect reserved paths on Windows." + ) + def is_reserved(self) -> bool: ... + else: + def is_reserved(self) -> bool: ... if sys.version_info >= (3, 14): def is_relative_to(self, other: StrPath) -> bool: ... elif sys.version_info >= (3, 12): @@ -163,7 +170,6 @@ class Path(PurePath): def mkdir(self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False) -> None: ... if sys.version_info >= (3, 14): - @property def info(self) -> PathInfo: ... @overload