-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy path__init__.pyi
More file actions
83 lines (78 loc) · 3 KB
/
__init__.pyi
File metadata and controls
83 lines (78 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import sys
from _typeshed import StrPath
from collections.abc import Iterator, Sequence
from io import TextIOWrapper
from os import PathLike
from typing import IO, Literal, TypeVar, overload
from typing_extensions import Self
from zipfile import ZipFile
_ZF = TypeVar("_ZF", bound=ZipFile)
if sys.version_info >= (3, 12):
__all__ = ["Path"]
class InitializedState:
def __init__(self, *args: object, **kwargs: object) -> None: ...
def __getstate__(self) -> tuple[list[object], dict[object, object]]: ...
def __setstate__(self, state: Sequence[tuple[list[object], dict[object, object]]]) -> None: ...
class CompleteDirs(InitializedState, ZipFile):
def resolve_dir(self, name: str) -> str: ...
@overload
@classmethod
def make(cls, source: ZipFile) -> CompleteDirs: ...
@overload
@classmethod
def make(cls, source: StrPath | IO[bytes]) -> Self: ...
if sys.version_info >= (3, 13):
@classmethod
def inject(cls, zf: _ZF) -> _ZF: ...
class Path:
root: CompleteDirs
at: str
def __init__(self, root: ZipFile | StrPath | IO[bytes], at: str = "") -> None: ...
@property
def name(self) -> str: ...
@property
def parent(self) -> PathLike[str]: ... # undocumented
@property
def filename(self) -> PathLike[str]: ... # undocumented
@property
def suffix(self) -> str: ...
@property
def suffixes(self) -> list[str]: ...
@property
def stem(self) -> str: ...
@overload
def open(
self,
mode: Literal["r", "w"] = "r",
encoding: str | None = None,
errors: str | None = None,
newline: str | None = None,
line_buffering: bool = False,
write_through: bool = False,
*,
pwd: bytes | None = None,
) -> TextIOWrapper: ...
@overload
def open(self, mode: Literal["rb", "wb"], *, pwd: bytes | None = None) -> IO[bytes]: ...
def iterdir(self) -> Iterator[Self]: ...
def is_dir(self) -> bool: ...
def is_file(self) -> bool: ...
def exists(self) -> bool: ...
def read_text(
self,
encoding: str | None = None,
errors: str | None = None,
newline: str | None = None,
line_buffering: bool = False,
write_through: bool = False,
) -> str: ...
def read_bytes(self) -> bytes: ...
def joinpath(self, *other: StrPath) -> Path: ...
def glob(self, pattern: str) -> Iterator[Self]: ...
def rglob(self, pattern: str) -> Iterator[Self]: ...
def is_symlink(self) -> Literal[False]: ...
def relative_to(self, other: Path, *extra: StrPath) -> str: ...
def match(self, path_pattern: str) -> bool: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
def __truediv__(self, add: StrPath) -> Path: ...