-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy path__init__.pyi
More file actions
105 lines (98 loc) · 2.09 KB
/
__init__.pyi
File metadata and controls
105 lines (98 loc) · 2.09 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import sys
from _typeshed import StrOrBytesPath
from collections.abc import Iterator, MutableMapping
from types import TracebackType
from typing import Literal, type_check_only
from typing_extensions import Self, TypeAlias
__all__ = ["open", "whichdb", "error"]
_KeyType: TypeAlias = str | bytes
_ValueType: TypeAlias = str | bytes | bytearray
_TFlags: TypeAlias = Literal[
"r",
"w",
"c",
"n",
"rf",
"wf",
"cf",
"nf",
"rs",
"ws",
"cs",
"ns",
"ru",
"wu",
"cu",
"nu",
"rfs",
"wfs",
"cfs",
"nfs",
"rfu",
"wfu",
"cfu",
"nfu",
"rsf",
"wsf",
"csf",
"nsf",
"rsu",
"wsu",
"csu",
"nsu",
"ruf",
"wuf",
"cuf",
"nuf",
"rus",
"wus",
"cus",
"nus",
"rfsu",
"wfsu",
"cfsu",
"nfsu",
"rfus",
"wfus",
"cfus",
"nfus",
"rsfu",
"wsfu",
"csfu",
"nsfu",
"rsuf",
"wsuf",
"csuf",
"nsuf",
"rufs",
"wufs",
"cufs",
"nufs",
"rusf",
"wusf",
"cusf",
"nusf",
]
@type_check_only
class _Database(MutableMapping[_KeyType, bytes]):
def close(self) -> None: ...
def __getitem__(self, key: _KeyType) -> bytes: ...
def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ...
def __delitem__(self, key: _KeyType) -> None: ...
def __iter__(self) -> Iterator[bytes]: ...
def __len__(self) -> int: ...
def __del__(self) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
# This class is not exposed. It calls itself dbm.error.
@type_check_only
class _error(Exception): ...
error: tuple[type[_error], type[OSError]]
if sys.version_info >= (3, 11):
def whichdb(filename: StrOrBytesPath) -> str | None: ...
def open(file: StrOrBytesPath, flag: _TFlags = "r", mode: int = 0o666) -> _Database: ...
else:
def whichdb(filename: str) -> str | None: ...
def open(file: str, flag: _TFlags = "r", mode: int = 0o666) -> _Database: ...