Skip to content

Commit 3bf7f35

Browse files
authored
[pathlib] Deprecate additional arguments (#15228)
1 parent a68aa25 commit 3bf7f35

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

stdlib/pathlib/__init__.pyi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ class PurePath(PathLike[str]):
104104
if sys.version_info >= (3, 14):
105105
def is_relative_to(self, other: StrPath) -> bool: ...
106106
elif sys.version_info >= (3, 12):
107+
@overload
108+
def is_relative_to(self, other: StrPath, /) -> bool: ...
109+
@overload
110+
@deprecated("Passing additional arguments is deprecated since Python 3.12; removed in Python 3.14.")
107111
def is_relative_to(self, other: StrPath, /, *_deprecated: StrPath) -> bool: ...
108112
else:
109113
def is_relative_to(self, *other: StrPath) -> bool: ...
@@ -116,6 +120,10 @@ class PurePath(PathLike[str]):
116120
if sys.version_info >= (3, 14):
117121
def relative_to(self, other: StrPath, *, walk_up: bool = False) -> Self: ...
118122
elif sys.version_info >= (3, 12):
123+
@overload
124+
def relative_to(self, other: StrPath, /, *, walk_up: bool = False) -> Self: ...
125+
@overload
126+
@deprecated("Passing additional arguments is deprecated since Python 3.12; removed in Python 3.14.")
119127
def relative_to(self, other: StrPath, /, *_deprecated: StrPath, walk_up: bool = False) -> Self: ...
120128
else:
121129
def relative_to(self, *other: StrPath) -> Self: ...

0 commit comments

Comments
 (0)