mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Add isjunction and splitroot functions (#10642)
This commit is contained in:
@@ -42,6 +42,9 @@ from posixpath import (
|
||||
splitext as splitext,
|
||||
supports_unicode_filenames as supports_unicode_filenames,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
from posixpath import isjunction as isjunction, splitroot as splitroot
|
||||
from typing import AnyStr, overload
|
||||
from typing_extensions import LiteralString
|
||||
|
||||
@@ -85,6 +88,8 @@ __all__ = [
|
||||
"samestat",
|
||||
"commonpath",
|
||||
]
|
||||
if sys.version_info >= (3, 12):
|
||||
__all__ += ["isjunction", "splitroot"]
|
||||
|
||||
altsep: LiteralString
|
||||
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
@@ -33,21 +33,12 @@ importlib.resources.files
|
||||
importlib.util.module_for_loader
|
||||
importlib.util.set_loader
|
||||
importlib.util.set_package
|
||||
ntpath.__all__
|
||||
ntpath.isjunction
|
||||
ntpath.splitroot
|
||||
os.DirEntry.is_junction
|
||||
os.path.__all__
|
||||
os.path.isjunction
|
||||
os.path.splitroot
|
||||
pathlib.Path.__init__
|
||||
pathlib.PurePath.__init__
|
||||
pathlib.PurePath.is_relative_to
|
||||
pathlib.PurePath.relative_to
|
||||
poplib.POP3_SSL.__init__
|
||||
posixpath.__all__
|
||||
posixpath.isjunction
|
||||
posixpath.splitroot
|
||||
smtplib.SMTP.starttls
|
||||
smtplib.SMTP_SSL.__init__
|
||||
typing.ParamSpec.__mro_entries__
|
||||
|
||||
Reference in New Issue
Block a user