mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Remove macpath (removed in Python 3.8) (#11236)
This commit is contained in:
@@ -170,7 +170,6 @@ linecache: 3.0-
|
||||
locale: 3.0-
|
||||
logging: 3.0-
|
||||
lzma: 3.3-
|
||||
macpath: 3.0-3.7
|
||||
mailbox: 3.0-
|
||||
mailcap: 3.0-3.12
|
||||
marshal: 3.0-
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
from _typeshed import BytesPath, StrOrBytesPath, StrPath
|
||||
from genericpath import (
|
||||
commonprefix as commonprefix,
|
||||
exists as exists,
|
||||
getatime as getatime,
|
||||
getctime as getctime,
|
||||
getmtime as getmtime,
|
||||
getsize as getsize,
|
||||
isdir as isdir,
|
||||
isfile as isfile,
|
||||
samefile as samefile,
|
||||
sameopenfile as sameopenfile,
|
||||
samestat as samestat,
|
||||
)
|
||||
from os import PathLike
|
||||
|
||||
# Re-export common definitions from posixpath to reduce duplication
|
||||
from posixpath import (
|
||||
abspath as abspath,
|
||||
curdir as curdir,
|
||||
defpath as defpath,
|
||||
devnull as devnull,
|
||||
expanduser as expanduser,
|
||||
expandvars as expandvars,
|
||||
extsep as extsep,
|
||||
isabs as isabs,
|
||||
lexists as lexists,
|
||||
pardir as pardir,
|
||||
pathsep as pathsep,
|
||||
sep as sep,
|
||||
splitdrive as splitdrive,
|
||||
splitext as splitext,
|
||||
supports_unicode_filenames as supports_unicode_filenames,
|
||||
)
|
||||
from typing import AnyStr, overload
|
||||
|
||||
__all__ = [
|
||||
"normcase",
|
||||
"isabs",
|
||||
"join",
|
||||
"splitdrive",
|
||||
"split",
|
||||
"splitext",
|
||||
"basename",
|
||||
"dirname",
|
||||
"commonprefix",
|
||||
"getsize",
|
||||
"getmtime",
|
||||
"getatime",
|
||||
"getctime",
|
||||
"islink",
|
||||
"exists",
|
||||
"lexists",
|
||||
"isdir",
|
||||
"isfile",
|
||||
"expanduser",
|
||||
"expandvars",
|
||||
"normpath",
|
||||
"abspath",
|
||||
"curdir",
|
||||
"pardir",
|
||||
"sep",
|
||||
"pathsep",
|
||||
"defpath",
|
||||
"altsep",
|
||||
"extsep",
|
||||
"devnull",
|
||||
"realpath",
|
||||
"supports_unicode_filenames",
|
||||
]
|
||||
|
||||
altsep: str | None
|
||||
|
||||
@overload
|
||||
def basename(s: PathLike[AnyStr]) -> AnyStr: ...
|
||||
@overload
|
||||
def basename(s: AnyStr) -> AnyStr: ...
|
||||
@overload
|
||||
def dirname(s: PathLike[AnyStr]) -> AnyStr: ...
|
||||
@overload
|
||||
def dirname(s: AnyStr) -> AnyStr: ...
|
||||
@overload
|
||||
def normcase(path: PathLike[AnyStr]) -> AnyStr: ...
|
||||
@overload
|
||||
def normcase(path: AnyStr) -> AnyStr: ...
|
||||
@overload
|
||||
def normpath(s: PathLike[AnyStr]) -> AnyStr: ...
|
||||
@overload
|
||||
def normpath(s: AnyStr) -> AnyStr: ...
|
||||
@overload
|
||||
def realpath(path: PathLike[AnyStr]) -> AnyStr: ...
|
||||
@overload
|
||||
def realpath(path: AnyStr) -> AnyStr: ...
|
||||
def islink(s: StrOrBytesPath) -> bool: ...
|
||||
|
||||
# Mypy complains that the signatures overlap, but things seem to behave correctly anyway.
|
||||
@overload
|
||||
def join(s: StrPath, *paths: StrPath) -> str: ...
|
||||
@overload
|
||||
def join(s: BytesPath, *paths: BytesPath) -> bytes: ...
|
||||
@overload
|
||||
def split(s: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ...
|
||||
@overload
|
||||
def split(s: AnyStr) -> tuple[AnyStr, AnyStr]: ...
|
||||
Reference in New Issue
Block a user