2 from _typeshed import BytesPath, StrPath
3 from genericpath import (
4 commonprefix as commonprefix,
13 sameopenfile as sameopenfile,
16 from os import PathLike
18 # Re-export common definitions from posixpath to reduce duplication
19 from posixpath import (
22 commonpath as commonpath,
27 expanduser as expanduser,
28 expandvars as expandvars,
41 splitdrive as splitdrive,
43 supports_unicode_filenames as supports_unicode_filenames,
45 from typing import AnyStr, overload
48 if sys.version_info < (3, 7) and sys.platform == "win32":
49 def splitunc(p: AnyStr) -> tuple[AnyStr, AnyStr]: ... # deprecated
51 # Similar to posixpath, but have slightly different argument names
53 def join(path: StrPath, *paths: StrPath) -> str: ...
55 def join(path: BytesPath, *paths: BytesPath) -> bytes: ...
57 if sys.platform == "win32":
58 if sys.version_info >= (3, 10):
60 def realpath(path: PathLike[AnyStr], *, strict: bool = ...) -> AnyStr: ...
62 def realpath(path: AnyStr, *, strict: bool = ...) -> AnyStr: ...
65 def realpath(path: PathLike[AnyStr]) -> AnyStr: ...
67 def realpath(path: AnyStr) -> AnyStr: ...