1 from _typeshed import BytesPath, StrOrBytesPath, StrPath
2 from genericpath import (
3 commonprefix as commonprefix,
12 sameopenfile as sameopenfile,
15 from os import PathLike
17 # Re-export common definitions from posixpath to reduce duplication
18 from posixpath import (
23 expanduser as expanduser,
24 expandvars as expandvars,
31 splitdrive as splitdrive,
33 supports_unicode_filenames as supports_unicode_filenames,
35 from typing import AnyStr, overload
40 def basename(s: PathLike[AnyStr]) -> AnyStr: ...
42 def basename(s: AnyStr) -> AnyStr: ...
44 def dirname(s: PathLike[AnyStr]) -> AnyStr: ...
46 def dirname(s: AnyStr) -> AnyStr: ...
48 def normcase(path: PathLike[AnyStr]) -> AnyStr: ...
50 def normcase(path: AnyStr) -> AnyStr: ...
52 def normpath(s: PathLike[AnyStr]) -> AnyStr: ...
54 def normpath(s: AnyStr) -> AnyStr: ...
56 def realpath(path: PathLike[AnyStr]) -> AnyStr: ...
58 def realpath(path: AnyStr) -> AnyStr: ...
59 def islink(s: StrOrBytesPath) -> bool: ...
61 # Mypy complains that the signatures overlap, but things seem to behave correctly anyway.
63 def join(s: StrPath, *paths: StrPath) -> str: ...
65 def join(s: BytesPath, *paths: BytesPath) -> bytes: ...
67 def split(s: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ...
69 def split(s: AnyStr) -> tuple[AnyStr, AnyStr]: ...