2 from _typeshed import BytesPath, StrOrBytesPath, StrPath
3 from genericpath import (
4 commonprefix as commonprefix,
13 sameopenfile as sameopenfile,
16 from os import PathLike
17 from typing import AnyStr, Sequence, overload
19 supports_unicode_filenames: bool
20 # aliases (also in os)
30 # Overloads are necessary to work around python/mypy#3644.
32 def abspath(path: PathLike[AnyStr]) -> AnyStr: ...
34 def abspath(path: AnyStr) -> AnyStr: ...
36 def basename(p: PathLike[AnyStr]) -> AnyStr: ...
38 def basename(p: AnyStr) -> AnyStr: ...
40 def dirname(p: PathLike[AnyStr]) -> AnyStr: ...
42 def dirname(p: AnyStr) -> AnyStr: ...
44 def expanduser(path: PathLike[AnyStr]) -> AnyStr: ...
46 def expanduser(path: AnyStr) -> AnyStr: ...
48 def expandvars(path: PathLike[AnyStr]) -> AnyStr: ...
50 def expandvars(path: AnyStr) -> AnyStr: ...
52 def normcase(s: PathLike[AnyStr]) -> AnyStr: ...
54 def normcase(s: AnyStr) -> AnyStr: ...
56 def normpath(path: PathLike[AnyStr]) -> AnyStr: ...
58 def normpath(path: AnyStr) -> AnyStr: ...
60 def commonpath(paths: Sequence[StrPath]) -> str: ...
62 def commonpath(paths: Sequence[BytesPath]) -> bytes: ...
64 def join(a: StrPath, *paths: StrPath) -> str: ...
66 def join(a: BytesPath, *paths: BytesPath) -> bytes: ...
68 if sys.version_info >= (3, 10):
70 def realpath(filename: PathLike[AnyStr], *, strict: bool = ...) -> AnyStr: ...
72 def realpath(filename: AnyStr, *, strict: bool = ...) -> AnyStr: ...
76 def realpath(filename: PathLike[AnyStr]) -> AnyStr: ...
78 def realpath(filename: AnyStr) -> AnyStr: ...
81 def relpath(path: BytesPath, start: BytesPath | None = ...) -> bytes: ...
83 def relpath(path: StrPath, start: StrPath | None = ...) -> str: ...
85 def split(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ...
87 def split(p: AnyStr) -> tuple[AnyStr, AnyStr]: ...
89 def splitdrive(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ...
91 def splitdrive(p: AnyStr) -> tuple[AnyStr, AnyStr]: ...
93 def splitext(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ...
95 def splitext(p: AnyStr) -> tuple[AnyStr, AnyStr]: ...
96 def isabs(s: StrOrBytesPath) -> bool: ...
97 def islink(path: StrOrBytesPath | int) -> bool: ...
98 def ismount(path: StrOrBytesPath | int) -> bool: ...
99 def lexists(path: StrOrBytesPath | int) -> bool: ...