massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / dbm / __init__.pyi
1 from _typeshed import Self
2 from types import TracebackType
3 from typing import Iterator, MutableMapping, Tuple, Type, Union
4 from typing_extensions import Literal
5
6 _KeyType = Union[str, bytes]
7 _ValueType = Union[str, bytes]
8 _TFlags = Literal[
9     "r",
10     "w",
11     "c",
12     "n",
13     "rf",
14     "wf",
15     "cf",
16     "nf",
17     "rs",
18     "ws",
19     "cs",
20     "ns",
21     "ru",
22     "wu",
23     "cu",
24     "nu",
25     "rfs",
26     "wfs",
27     "cfs",
28     "nfs",
29     "rfu",
30     "wfu",
31     "cfu",
32     "nfu",
33     "rsf",
34     "wsf",
35     "csf",
36     "nsf",
37     "rsu",
38     "wsu",
39     "csu",
40     "nsu",
41     "ruf",
42     "wuf",
43     "cuf",
44     "nuf",
45     "rus",
46     "wus",
47     "cus",
48     "nus",
49     "rfsu",
50     "wfsu",
51     "cfsu",
52     "nfsu",
53     "rfus",
54     "wfus",
55     "cfus",
56     "nfus",
57     "rsfu",
58     "wsfu",
59     "csfu",
60     "nsfu",
61     "rsuf",
62     "wsuf",
63     "csuf",
64     "nsuf",
65     "rufs",
66     "wufs",
67     "cufs",
68     "nufs",
69     "rusf",
70     "wusf",
71     "cusf",
72     "nusf",
73 ]
74
75 class _Database(MutableMapping[_KeyType, bytes]):
76     def close(self) -> None: ...
77     def __getitem__(self, key: _KeyType) -> bytes: ...
78     def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ...
79     def __delitem__(self, key: _KeyType) -> None: ...
80     def __iter__(self) -> Iterator[bytes]: ...
81     def __len__(self) -> int: ...
82     def __del__(self) -> None: ...
83     def __enter__(self: Self) -> Self: ...
84     def __exit__(
85         self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
86     ) -> None: ...
87
88 class _error(Exception): ...
89
90 error = Tuple[Type[_error], Type[OSError]]
91
92 def whichdb(filename: str) -> str: ...
93 def open(file: str, flag: _TFlags = ..., mode: int = ...) -> _Database: ...