Show More
@@ -50,6 +50,22 b' else:' | |||||
50 |
|
50 | |||
51 | class CannedObject(object): |
|
51 | class CannedObject(object): | |
52 | def __init__(self, obj, keys=[], hook=None): |
|
52 | def __init__(self, obj, keys=[], hook=None): | |
|
53 | """can an object for safe pickling | |||
|
54 | ||||
|
55 | Parameters | |||
|
56 | ========== | |||
|
57 | ||||
|
58 | obj: | |||
|
59 | The object to be canned | |||
|
60 | keys: list (optional) | |||
|
61 | list of attribute names that will be explicitly canned / uncanned | |||
|
62 | hook: callable (optional) | |||
|
63 | An optional extra callable, | |||
|
64 | which can do additional processing of the uncanned object. | |||
|
65 | ||||
|
66 | large data may be offloaded into the buffers list, | |||
|
67 | used for zero-copy transfers. | |||
|
68 | """ | |||
53 | self.keys = keys |
|
69 | self.keys = keys | |
54 | self.obj = copy.copy(obj) |
|
70 | self.obj = copy.copy(obj) | |
55 | self.hook = can(hook) |
|
71 | self.hook = can(hook) |
General Comments 0
You need to be logged in to leave comments.
Login now