1 from typing import IO, Any, Callable, Iterator, MutableMapping, Tuple, Type
3 _Reader = Callable[[IO[bytes]], Any]
4 bytes_types: Tuple[Type[Any], ...]
7 TAKEN_FROM_ARGUMENT1: int
8 TAKEN_FROM_ARGUMENT4: int
9 TAKEN_FROM_ARGUMENT4U: int
10 TAKEN_FROM_ARGUMENT8U: int
12 class ArgumentDescriptor(object):
17 def __init__(self, name: str, n: int, reader: _Reader, doc: str) -> None: ...
19 def read_uint1(f: IO[bytes]) -> int: ...
21 uint1: ArgumentDescriptor
23 def read_uint2(f: IO[bytes]) -> int: ...
25 uint2: ArgumentDescriptor
27 def read_int4(f: IO[bytes]) -> int: ...
29 int4: ArgumentDescriptor
31 def read_uint4(f: IO[bytes]) -> int: ...
33 uint4: ArgumentDescriptor
35 def read_uint8(f: IO[bytes]) -> int: ...
37 uint8: ArgumentDescriptor
39 def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> bytes | str: ...
41 stringnl: ArgumentDescriptor
43 def read_stringnl_noescape(f: IO[bytes]) -> str: ...
45 stringnl_noescape: ArgumentDescriptor
47 def read_stringnl_noescape_pair(f: IO[bytes]) -> str: ...
49 stringnl_noescape_pair: ArgumentDescriptor
51 def read_string1(f: IO[bytes]) -> str: ...
53 string1: ArgumentDescriptor
55 def read_string4(f: IO[bytes]) -> str: ...
57 string4: ArgumentDescriptor
59 def read_bytes1(f: IO[bytes]) -> bytes: ...
61 bytes1: ArgumentDescriptor
63 def read_bytes4(f: IO[bytes]) -> bytes: ...
65 bytes4: ArgumentDescriptor
67 def read_bytes8(f: IO[bytes]) -> bytes: ...
69 bytes8: ArgumentDescriptor
71 def read_unicodestringnl(f: IO[bytes]) -> str: ...
73 unicodestringnl: ArgumentDescriptor
75 def read_unicodestring1(f: IO[bytes]) -> str: ...
77 unicodestring1: ArgumentDescriptor
79 def read_unicodestring4(f: IO[bytes]) -> str: ...
81 unicodestring4: ArgumentDescriptor
83 def read_unicodestring8(f: IO[bytes]) -> str: ...
85 unicodestring8: ArgumentDescriptor
87 def read_decimalnl_short(f: IO[bytes]) -> int: ...
88 def read_decimalnl_long(f: IO[bytes]) -> int: ...
90 decimalnl_short: ArgumentDescriptor
91 decimalnl_long: ArgumentDescriptor
93 def read_floatnl(f: IO[bytes]) -> float: ...
95 floatnl: ArgumentDescriptor
97 def read_float8(f: IO[bytes]) -> float: ...
99 float8: ArgumentDescriptor
101 def read_long1(f: IO[bytes]) -> int: ...
103 long1: ArgumentDescriptor
105 def read_long4(f: IO[bytes]) -> int: ...
107 long4: ArgumentDescriptor
109 class StackObject(object):
111 obtype: Type[Any] | Tuple[Type[Any], ...]
113 def __init__(self, name: str, obtype: Type[Any] | Tuple[Type[Any], ...], doc: str) -> None: ...
117 pyinteger_or_bool: StackObject
120 pybytes_or_str: StackObject
121 pystring: StackObject
123 pyunicode: StackObject
129 pyfrozenset: StackObject
130 anyobject: StackObject
131 markobject: StackObject
132 stackslice: StackObject
134 class OpcodeInfo(object):
137 arg: ArgumentDescriptor | None
138 stack_before: list[StackObject]
139 stack_after: list[StackObject]
146 arg: ArgumentDescriptor | None,
147 stack_before: list[StackObject],
148 stack_after: list[StackObject],
153 opcodes: list[OpcodeInfo]
155 def genops(pickle: bytes | IO[bytes]) -> Iterator[tuple[OpcodeInfo, Any | None, int | None]]: ...
156 def optimize(p: bytes | IO[bytes]) -> bytes: ...
158 pickle: bytes | IO[bytes],
159 out: IO[str] | None = ...,
160 memo: MutableMapping[int, Any] | None = ...,
161 indentlevel: int = ...,