forked from JetBrains/python-skeletons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpickle.py
81 lines (52 loc) · 1.76 KB
/
pickle.py
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
"""Skeleton for 'pickle' stdlib module."""
HIGHEST_PROTOCOL = 0
DEFAULT_PROTOCOL = 0
def dump(obj, file, protocol=None, fix_imports=True):
"""Write a pickled representation of obj to the open file object file.
:type protocol: numbers.Integral | None
:rtype: None
"""
pass
def dumps(obj, protocol=None, fix_imports=True):
"""Return the pickled representation of the object as a bytes object,
instead of writing it to a file.
:type protocol: numbers.Integral | None
:rtype: bytes
"""
return b''
def load(file, fix_imports=True, encoding='ASCII', errors='strict'):
"""Read a pickled object representation from the open file object file and
return the reconstituted object hierarchy specified therein.
"""
pass
def loads(bytes_object, fix_imports=True, encoding='ASCII', errors='strict'):
"""Read a pickled object representation from the open file object file and
return the reconstituted object hierarchy specified therein.
"""
pass
class PickleError(Exception):
pass
class PicklingError(PickleError):
pass
class UnpicklingError(PickleError):
pass
class Pickler(object):
"""This takes a binary file for writing a pickle data stream."""
def __init__(self, file, protocol=None, fix_imports=True):
self.dispatch_table = None
self.fast = False
def dump(self, obj):
pass
def persistent_id(self, obj):
pass
class Unpickler(object):
"""This takes a binary file for reading a pickle data stream."""
def __init__(self, file, fix_imports=True, encoding='ASCII',
errors='strict'):
pass
def load(self):
pass
def persistent_load(self, pid):
pass
def find_class(self, module, name):
pass