Skip to content

Commit

Permalink
refactor(pathlib): allow PathLike[str] arg type in Path.replace and P…
Browse files Browse the repository at this point in the history
…ath.rename methods (#12494)
  • Loading branch information
hoefling authored Aug 7, 2024
1 parent 92cc568 commit e9b3b03
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions stdlib/pathlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down

0 comments on commit e9b3b03

Please sign in to comment.