Skip to content

[pathlib] Deprecate PurePath.is_reserved #14478

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
Aug 1, 2025
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
10 changes: 8 additions & 2 deletions stdlib/pathlib/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extraneous whitespace change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like it should have been formatted with typeshed linters earlier. but apparently it didn't fall under any rule earlier and it happened automatically in my editor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, when I run black via pre-commit locally, I'm not seeing this diff. Possibly your editor is configured to run ruff format, which does seem to make this change?

@property
def info(self) -> PathInfo: ...
@overload
Expand Down
Loading