@@ -197,8 +197,9 @@ process more convenient:
197
197
198
198
.. function :: dump(obj, file, protocol=None, \*, fix_imports=True, buffer_callback=None)
199
199
200
- Write a pickled representation of *obj * to the open :term: `file object ` *file *.
201
- This is equivalent to ``Pickler(file, protocol).dump(obj) ``.
200
+ Write the pickled representation of the object *obj * to the open
201
+ :term: `file object ` *file *. This is equivalent to
202
+ ``Pickler(file, protocol).dump(obj) ``.
202
203
203
204
Arguments *file *, *protocol *, *fix_imports * and *buffer_callback * have
204
205
the same meaning as in the :class: `Pickler ` constructor.
@@ -208,7 +209,7 @@ process more convenient:
208
209
209
210
.. function :: dumps(obj, protocol=None, \*, fix_imports=True, buffer_callback=None)
210
211
211
- Return the pickled representation of the object as a :class: `bytes ` object,
212
+ Return the pickled representation of the object * obj * as a :class: `bytes ` object,
212
213
instead of writing it to a file.
213
214
214
215
Arguments *protocol *, *fix_imports * and *buffer_callback * have the same
@@ -219,13 +220,13 @@ process more convenient:
219
220
220
221
.. function :: load(file, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
221
222
222
- Read a pickled object representation from the open :term: `file object `
223
+ Read the pickled representation of an object from the open :term: `file object `
223
224
*file * and return the reconstituted object hierarchy specified therein.
224
225
This is equivalent to ``Unpickler(file).load() ``.
225
226
226
227
The protocol version of the pickle is detected automatically, so no
227
- protocol argument is needed. Bytes past the pickled object's
228
- representation are ignored.
228
+ protocol argument is needed. Bytes past the pickled representation
229
+ of the object are ignored.
229
230
230
231
Arguments *file *, *fix_imports *, *encoding *, *errors *, *strict * and *buffers *
231
232
have the same meaning as in the :class: `Unpickler ` constructor.
@@ -235,12 +236,12 @@ process more convenient:
235
236
236
237
.. function :: loads(bytes_object, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
237
238
238
- Read a pickled object hierarchy from a :class: ` bytes ` object and return the
239
- reconstituted object hierarchy specified therein .
239
+ Return the reconstituted object hierarchy of the pickled representation
240
+ * bytes_object * of an object .
240
241
241
242
The protocol version of the pickle is detected automatically, so no
242
- protocol argument is needed. Bytes past the pickled object's
243
- representation are ignored.
243
+ protocol argument is needed. Bytes past the pickled representation
244
+ of the object are ignored.
244
245
245
246
Arguments *file *, *fix_imports *, *encoding *, *errors *, *strict * and *buffers *
246
247
have the same meaning as in the :class: `Unpickler ` constructor.
@@ -311,7 +312,7 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
311
312
312
313
.. method :: dump(obj)
313
314
314
- Write a pickled representation of *obj * to the open file object given in
315
+ Write the pickled representation of *obj * to the open file object given in
315
316
the constructor.
316
317
317
318
.. method :: persistent_id(obj)
@@ -412,9 +413,10 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
412
413
413
414
.. method :: load()
414
415
415
- Read a pickled object representation from the open file object given in
416
- the constructor, and return the reconstituted object hierarchy specified
417
- therein. Bytes past the pickled object's representation are ignored.
416
+ Read the pickled representation of an object from the open file object
417
+ given in the constructor, and return the reconstituted object hierarchy
418
+ specified therein. Bytes past the pickled representation of the object
419
+ are ignored.
418
420
419
421
.. method :: persistent_load(pid)
420
422
@@ -717,13 +719,13 @@ alphanumeric characters (for protocol 0) [#]_ or just an arbitrary object (for
717
719
any newer protocol).
718
720
719
721
The resolution of such persistent IDs is not defined by the :mod: `pickle `
720
- module; it will delegate this resolution to the user defined methods on the
722
+ module; it will delegate this resolution to the user- defined methods on the
721
723
pickler and unpickler, :meth: `~Pickler.persistent_id ` and
722
724
:meth: `~Unpickler.persistent_load ` respectively.
723
725
724
- To pickle objects that have an external persistent id , the pickler must have a
726
+ To pickle objects that have an external persistent ID , the pickler must have a
725
727
custom :meth: `~Pickler.persistent_id ` method that takes an object as an
726
- argument and returns either ``None `` or the persistent id for that object.
728
+ argument and returns either ``None `` or the persistent ID for that object.
727
729
When ``None `` is returned, the pickler simply pickles the object as normal.
728
730
When a persistent ID string is returned, the pickler will pickle that object,
729
731
along with a marker so that the unpickler will recognize it as a persistent ID.
0 commit comments