Add isjunction and splitroot functions (#10642)

This commit is contained in:
Nikita Sobolev
2023-08-31 15:14:22 +03:00
committed by GitHub
parent a4f08bd07f
commit 8a2019aa7f
3 changed files with 14 additions and 9 deletions

View File

@@ -58,6 +58,8 @@ __all__ = [
"relpath",
"commonpath",
]
if sys.version_info >= (3, 12):
__all__ += ["isjunction", "splitroot"]
supports_unicode_filenames: bool
# aliases (also in os)
@@ -150,3 +152,10 @@ def isabs(s: StrOrBytesPath) -> bool: ...
def islink(path: FileDescriptorOrPath) -> bool: ...
def ismount(path: FileDescriptorOrPath) -> bool: ...
def lexists(path: FileDescriptorOrPath) -> bool: ...
if sys.version_info >= (3, 12):
def isjunction(path: StrOrBytesPath) -> bool: ...
@overload
def splitroot(p: AnyOrLiteralStr) -> tuple[AnyOrLiteralStr, AnyOrLiteralStr, AnyOrLiteralStr]: ...
@overload
def splitroot(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr, AnyStr]: ...