massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / pickle.pyi
1 import sys\r
2 from typing import Any, IO, Mapping, Union, Tuple, Callable, Optional, Iterator\r
3 \r
4 HIGHEST_PROTOCOL: int\r
5 if sys.version_info >= (3, 0):\r
6     DEFAULT_PROTOCOL: int\r
7 \r
8 \r
9 if sys.version_info >= (3, 0):\r
10     def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ..., *,\r
11              fix_imports: bool = ...) -> None: ...\r
12     def dumps(obj: Any, protocol: Optional[int] = ..., *,\r
13               fix_imports: bool = ...) -> bytes: ...\r
14     def loads(bytes_object: bytes, *, fix_imports: bool = ...,\r
15               encoding: str = ..., errors: str = ...) -> Any: ...\r
16     def load(file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ...,\r
17              errors: str = ...) -> Any: ...\r
18 else:\r
19     def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ...) -> None: ...\r
20     def dumps(obj: Any, protocol: Optional[int] = ...) -> bytes: ...\r
21     def load(file: IO[bytes]) -> Any: ...\r
22     def loads(string: bytes) -> Any: ...\r
23 \r
24 class PickleError(Exception): ...\r
25 class PicklingError(PickleError): ...\r
26 class UnpicklingError(PickleError): ...\r
27 \r
28 _reducedtype = Union[str,\r
29                      Tuple[Callable[..., Any], Tuple],\r
30                      Tuple[Callable[..., Any], Tuple, Any],\r
31                      Tuple[Callable[..., Any], Tuple, Any,\r
32                            Optional[Iterator]],\r
33                      Tuple[Callable[..., Any], Tuple, Any,\r
34                            Optional[Iterator], Optional[Iterator]]]\r
35 \r
36 \r
37 class Pickler:\r
38     fast: bool\r
39     if sys.version_info >= (3, 3):\r
40         dispatch_table: Mapping[type, Callable[[Any], _reducedtype]]\r
41 \r
42     if sys.version_info >= (3, 0):\r
43         def __init__(self, file: IO[bytes], protocol: Optional[int] = ..., *,\r
44                      fix_imports: bool = ...) -> None: ...\r
45     else:\r
46         def __init__(self, file: IO[bytes], protocol: Optional[int] = ...) -> None: ...\r
47 \r
48     def dump(self, obj: Any) -> None: ...\r
49     def clear_memo(self) -> None: ...\r
50     def persistent_id(self, obj: Any) -> Any: ...\r
51 \r
52 \r
53 class Unpickler:\r
54     if sys.version_info >= (3, 0):\r
55         def __init__(self, file: IO[bytes], *, fix_imports: bool = ...,\r
56                      encoding: str = ..., errors: str = ...) -> None: ...\r
57     else:\r
58         def __init__(self, file: IO[bytes]) -> None: ...\r
59 \r
60     def load(self) -> Any: ...\r
61     def find_class(self, module: str, name: str) -> Any: ...\r
62     if sys.version_info >= (3, 0):\r
63         def persistent_load(self, pid: Any) -> Any: ...\r
64 \r
65 MARK: bytes\r
66 STOP: bytes\r
67 POP: bytes\r
68 POP_MARK: bytes\r
69 DUP: bytes\r
70 FLOAT: bytes\r
71 INT: bytes\r
72 BININT: bytes\r
73 BININT1: bytes\r
74 LONG: bytes\r
75 BININT2: bytes\r
76 NONE: bytes\r
77 PERSID: bytes\r
78 BINPERSID: bytes\r
79 REDUCE: bytes\r
80 STRING: bytes\r
81 BINSTRING: bytes\r
82 SHORT_BINSTRING: bytes\r
83 UNICODE: bytes\r
84 BINUNICODE: bytes\r
85 APPEND: bytes\r
86 BUILD: bytes\r
87 GLOBAL: bytes\r
88 DICT: bytes\r
89 EMPTY_DICT: bytes\r
90 APPENDS: bytes\r
91 GET: bytes\r
92 BINGET: bytes\r
93 INST: bytes\r
94 LONG_BINGET: bytes\r
95 LIST: bytes\r
96 EMPTY_LIST: bytes\r
97 OBJ: bytes\r
98 PUT: bytes\r
99 BINPUT: bytes\r
100 LONG_BINPUT: bytes\r
101 SETITEM: bytes\r
102 TUPLE: bytes\r
103 EMPTY_TUPLE: bytes\r
104 SETITEMS: bytes\r
105 BINFLOAT: bytes\r
106 \r
107 TRUE: bytes\r
108 FALSE: bytes\r
109 \r
110 # protocol 2\r
111 PROTO: bytes\r
112 NEWOBJ: bytes\r
113 EXT1: bytes\r
114 EXT2: bytes\r
115 EXT4: bytes\r
116 TUPLE1: bytes\r
117 TUPLE2: bytes\r
118 TUPLE3: bytes\r
119 NEWTRUE: bytes\r
120 NEWFALSE: bytes\r
121 LONG1: bytes\r
122 LONG4: bytes\r
123 \r
124 if sys.version_info >= (3, 0):\r
125     # protocol 3\r
126     BINBYTES: bytes\r
127     SHORT_BINBYTES: bytes\r
128 \r
129 if sys.version_info >= (3, 4):\r
130     # protocol 4\r
131     SHORT_BINUNICODE: bytes\r
132     BINUNICODE8: bytes\r
133     BINBYTES8: bytes\r
134     EMPTY_SET: bytes\r
135     ADDITEMS: bytes\r
136     FROZENSET: bytes\r
137     NEWOBJ_EX: bytes\r
138     STACK_GLOBAL: bytes\r
139     MEMOIZE: bytes\r
140     FRAME: bytes\r