@@ -211,8 +211,9 @@ process more convenient:
211
211
212
212
.. function :: dump(obj, file, protocol=None, \*, fix_imports=True, buffer_callback=None)
213
213
214
- Write a pickled representation of *obj * to the open :term: `file object ` *file *.
215
- This is equivalent to ``Pickler(file, protocol).dump(obj) ``.
214
+ Write the pickled representation of the object *obj * to the open
215
+ :term: `file object ` *file *. This is equivalent to
216
+ ``Pickler(file, protocol).dump(obj) ``.
216
217
217
218
Arguments *file *, *protocol *, *fix_imports * and *buffer_callback * have
218
219
the same meaning as in the :class: `Pickler ` constructor.
@@ -222,7 +223,7 @@ process more convenient:
222
223
223
224
.. function :: dumps(obj, protocol=None, \*, fix_imports=True, buffer_callback=None)
224
225
225
- Return the pickled representation of the object as a :class: `bytes ` object,
226
+ Return the pickled representation of the object * obj * as a :class: `bytes ` object,
226
227
instead of writing it to a file.
227
228
228
229
Arguments *protocol *, *fix_imports * and *buffer_callback * have the same
@@ -233,13 +234,13 @@ process more convenient:
233
234
234
235
.. function :: load(file, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
235
236
236
- Read a pickled object representation from the open :term: `file object `
237
+ Read the pickled representation of an object from the open :term: `file object `
237
238
*file * and return the reconstituted object hierarchy specified therein.
238
239
This is equivalent to ``Unpickler(file).load() ``.
239
240
240
241
The protocol version of the pickle is detected automatically, so no
241
- protocol argument is needed. Bytes past the pickled object's
242
- representation are ignored.
242
+ protocol argument is needed. Bytes past the pickled representation
243
+ of the object are ignored.
243
244
244
245
Arguments *file *, *fix_imports *, *encoding *, *errors *, *strict * and *buffers *
245
246
have the same meaning as in the :class: `Unpickler ` constructor.
@@ -249,12 +250,12 @@ process more convenient:
249
250
250
251
.. function :: loads(bytes_object, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
251
252
252
- Read a pickled object hierarchy from a :class: ` bytes ` object and return the
253
- reconstituted object hierarchy specified therein .
253
+ Return the reconstituted object hierarchy of the pickled representation
254
+ * bytes_object * of an object .
254
255
255
256
The protocol version of the pickle is detected automatically, so no
256
- protocol argument is needed. Bytes past the pickled object's
257
- representation are ignored.
257
+ protocol argument is needed. Bytes past the pickled representation
258
+ of the object are ignored.
258
259
259
260
Arguments *file *, *fix_imports *, *encoding *, *errors *, *strict * and *buffers *
260
261
have the same meaning as in the :class: `Unpickler ` constructor.
@@ -325,7 +326,7 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
325
326
326
327
.. method :: dump(obj)
327
328
328
- Write a pickled representation of *obj * to the open file object given in
329
+ Write the pickled representation of *obj * to the open file object given in
329
330
the constructor.
330
331
331
332
.. method :: persistent_id(obj)
@@ -426,9 +427,10 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
426
427
427
428
.. method :: load()
428
429
429
- Read a pickled object representation from the open file object given in
430
- the constructor, and return the reconstituted object hierarchy specified
431
- therein. Bytes past the pickled object's representation are ignored.
430
+ Read the pickled representation of an object from the open file object
431
+ given in the constructor, and return the reconstituted object hierarchy
432
+ specified therein. Bytes past the pickled representation of the object
433
+ are ignored.
432
434
433
435
.. method :: persistent_load(pid)
434
436
@@ -731,13 +733,13 @@ alphanumeric characters (for protocol 0) [#]_ or just an arbitrary object (for
731
733
any newer protocol).
732
734
733
735
The resolution of such persistent IDs is not defined by the :mod: `pickle `
734
- module; it will delegate this resolution to the user defined methods on the
736
+ module; it will delegate this resolution to the user- defined methods on the
735
737
pickler and unpickler, :meth: `~Pickler.persistent_id ` and
736
738
:meth: `~Unpickler.persistent_load ` respectively.
737
739
738
- To pickle objects that have an external persistent id , the pickler must have a
740
+ To pickle objects that have an external persistent ID , the pickler must have a
739
741
custom :meth: `~Pickler.persistent_id ` method that takes an object as an
740
- argument and returns either ``None `` or the persistent id for that object.
742
+ argument and returns either ``None `` or the persistent ID for that object.
741
743
When ``None `` is returned, the pickler simply pickles the object as normal.
742
744
When a persistent ID string is returned, the pickler will pickle that object,
743
745
along with a marker so that the unpickler will recognize it as a persistent ID.
0 commit comments