refactor(pathlib): allow PathLike[str] arg type in Path.replace and Path.rename methods (#12494)

This commit is contained in:
Oleg Höfling
2024-08-07 15:43:13 +02:00
committed by GitHub
parent 92cc568325
commit e9b3b03764

View File

@@ -232,8 +232,13 @@ class Path(PurePath):
if sys.version_info >= (3, 9):
def readlink(self) -> Self: ...
def rename(self, target: str | PurePath) -> Self: ...
def replace(self, target: str | PurePath) -> Self: ...
if sys.version_info >= (3, 10):
def rename(self, target: StrPath) -> Self: ...
def replace(self, target: StrPath) -> Self: ...
else:
def rename(self, target: str | PurePath) -> Self: ...
def replace(self, target: str | PurePath) -> Self: ...
def resolve(self, strict: bool = False) -> Self: ...
def rmdir(self) -> None: ...
def symlink_to(self, target: StrOrBytesPath, target_is_directory: bool = False) -> None: ...