massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / pickletools.pyi
1 from typing import IO, Any, Callable, Iterator, MutableMapping, Tuple, Type
2
3 _Reader = Callable[[IO[bytes]], Any]
4 bytes_types: Tuple[Type[Any], ...]
5
6 UP_TO_NEWLINE: int
7 TAKEN_FROM_ARGUMENT1: int
8 TAKEN_FROM_ARGUMENT4: int
9 TAKEN_FROM_ARGUMENT4U: int
10 TAKEN_FROM_ARGUMENT8U: int
11
12 class ArgumentDescriptor(object):
13     name: str
14     n: int
15     reader: _Reader
16     doc: str
17     def __init__(self, name: str, n: int, reader: _Reader, doc: str) -> None: ...
18
19 def read_uint1(f: IO[bytes]) -> int: ...
20
21 uint1: ArgumentDescriptor
22
23 def read_uint2(f: IO[bytes]) -> int: ...
24
25 uint2: ArgumentDescriptor
26
27 def read_int4(f: IO[bytes]) -> int: ...
28
29 int4: ArgumentDescriptor
30
31 def read_uint4(f: IO[bytes]) -> int: ...
32
33 uint4: ArgumentDescriptor
34
35 def read_uint8(f: IO[bytes]) -> int: ...
36
37 uint8: ArgumentDescriptor
38
39 def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> bytes | str: ...
40
41 stringnl: ArgumentDescriptor
42
43 def read_stringnl_noescape(f: IO[bytes]) -> str: ...
44
45 stringnl_noescape: ArgumentDescriptor
46
47 def read_stringnl_noescape_pair(f: IO[bytes]) -> str: ...
48
49 stringnl_noescape_pair: ArgumentDescriptor
50
51 def read_string1(f: IO[bytes]) -> str: ...
52
53 string1: ArgumentDescriptor
54
55 def read_string4(f: IO[bytes]) -> str: ...
56
57 string4: ArgumentDescriptor
58
59 def read_bytes1(f: IO[bytes]) -> bytes: ...
60
61 bytes1: ArgumentDescriptor
62
63 def read_bytes4(f: IO[bytes]) -> bytes: ...
64
65 bytes4: ArgumentDescriptor
66
67 def read_bytes8(f: IO[bytes]) -> bytes: ...
68
69 bytes8: ArgumentDescriptor
70
71 def read_unicodestringnl(f: IO[bytes]) -> str: ...
72
73 unicodestringnl: ArgumentDescriptor
74
75 def read_unicodestring1(f: IO[bytes]) -> str: ...
76
77 unicodestring1: ArgumentDescriptor
78
79 def read_unicodestring4(f: IO[bytes]) -> str: ...
80
81 unicodestring4: ArgumentDescriptor
82
83 def read_unicodestring8(f: IO[bytes]) -> str: ...
84
85 unicodestring8: ArgumentDescriptor
86
87 def read_decimalnl_short(f: IO[bytes]) -> int: ...
88 def read_decimalnl_long(f: IO[bytes]) -> int: ...
89
90 decimalnl_short: ArgumentDescriptor
91 decimalnl_long: ArgumentDescriptor
92
93 def read_floatnl(f: IO[bytes]) -> float: ...
94
95 floatnl: ArgumentDescriptor
96
97 def read_float8(f: IO[bytes]) -> float: ...
98
99 float8: ArgumentDescriptor
100
101 def read_long1(f: IO[bytes]) -> int: ...
102
103 long1: ArgumentDescriptor
104
105 def read_long4(f: IO[bytes]) -> int: ...
106
107 long4: ArgumentDescriptor
108
109 class StackObject(object):
110     name: str
111     obtype: Type[Any] | Tuple[Type[Any], ...]
112     doc: str
113     def __init__(self, name: str, obtype: Type[Any] | Tuple[Type[Any], ...], doc: str) -> None: ...
114
115 pyint: StackObject
116 pylong: StackObject
117 pyinteger_or_bool: StackObject
118 pybool: StackObject
119 pyfloat: StackObject
120 pybytes_or_str: StackObject
121 pystring: StackObject
122 pybytes: StackObject
123 pyunicode: StackObject
124 pynone: StackObject
125 pytuple: StackObject
126 pylist: StackObject
127 pydict: StackObject
128 pyset: StackObject
129 pyfrozenset: StackObject
130 anyobject: StackObject
131 markobject: StackObject
132 stackslice: StackObject
133
134 class OpcodeInfo(object):
135     name: str
136     code: str
137     arg: ArgumentDescriptor | None
138     stack_before: list[StackObject]
139     stack_after: list[StackObject]
140     proto: int
141     doc: str
142     def __init__(
143         self,
144         name: str,
145         code: str,
146         arg: ArgumentDescriptor | None,
147         stack_before: list[StackObject],
148         stack_after: list[StackObject],
149         proto: int,
150         doc: str,
151     ) -> None: ...
152
153 opcodes: list[OpcodeInfo]
154
155 def genops(pickle: bytes | IO[bytes]) -> Iterator[tuple[OpcodeInfo, Any | None, int | None]]: ...
156 def optimize(p: bytes | IO[bytes]) -> bytes: ...
157 def dis(
158     pickle: bytes | IO[bytes],
159     out: IO[str] | None = ...,
160     memo: MutableMapping[int, Any] | None = ...,
161     indentlevel: int = ...,
162     annotate: int = ...,
163 ) -> None: ...