pathlib: more changes for py312 (#10261)

This commit is contained in:
Shantanu
2023-06-04 16:04:59 -07:00
committed by GitHub
parent 758afb35d4
commit f8dfacb851
2 changed files with 20 additions and 10 deletions

View File

@@ -55,7 +55,11 @@ class PurePath(PathLike[str]):
if sys.version_info >= (3, 9):
def is_relative_to(self, *other: StrPath) -> bool: ...
def match(self, path_pattern: str) -> bool: ...
if sys.version_info >= (3, 12):
def match(self, path_pattern: str, *, case_sensitive: bool | None = None) -> bool: ...
else:
def match(self, path_pattern: str) -> bool: ...
def relative_to(self, *other: StrPath) -> Self: ...
def with_name(self, name: str) -> Self: ...
if sys.version_info >= (3, 9):
@@ -70,6 +74,9 @@ class PurePath(PathLike[str]):
if sys.version_info >= (3, 9) and sys.version_info < (3, 11):
def __class_getitem__(cls, type: Any) -> GenericAlias: ...
if sys.version_info >= (3, 12):
def with_segments(self, *args: StrPath) -> Self: ...
class PurePosixPath(PurePath): ...
class PureWindowsPath(PurePath): ...
@@ -86,8 +93,15 @@ class Path(PurePath):
def stat(self) -> stat_result: ...
def chmod(self, mode: int) -> None: ...
def exists(self) -> bool: ...
def glob(self, pattern: str) -> Generator[Self, None, None]: ...
if sys.version_info >= (3, 12):
def exists(self, *, follow_symlinks: bool = True) -> bool: ...
def glob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ...
def rglob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ...
else:
def exists(self) -> bool: ...
def glob(self, pattern: str) -> Generator[Self, None, None]: ...
def rglob(self, pattern: str) -> Generator[Self, None, None]: ...
def is_dir(self) -> bool: ...
def is_file(self) -> bool: ...
def is_symlink(self) -> bool: ...
@@ -95,6 +109,9 @@ class Path(PurePath):
def is_fifo(self) -> bool: ...
def is_block_device(self) -> bool: ...
def is_char_device(self) -> bool: ...
if sys.version_info >= (3, 12):
def is_junction(self) -> bool: ...
def iterdir(self) -> Generator[Self, None, None]: ...
def lchmod(self, mode: int) -> None: ...
def lstat(self) -> stat_result: ...
@@ -175,7 +192,6 @@ class Path(PurePath):
def replace(self, target: str | PurePath) -> None: ...
def resolve(self, strict: bool = False) -> Self: ...
def rglob(self, pattern: str) -> Generator[Self, None, None]: ...
def rmdir(self) -> None: ...
def symlink_to(self, target: StrOrBytesPath, target_is_directory: bool = False) -> None: ...
if sys.version_info >= (3, 10):