[Python-checkins] (no subject)

Stéphane Wirtel webhook-mailer at python.org
Thu Sep 12 04:19:23 EDT 2019




To: python-checkins at python.org
Subject: Doc: Update pickle.rst (GH-14128) (GH-16014)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

https://github.com/python/cpython/commit/eb19c45298361d75f744dcda295fa635a849=
0c3c
commit: eb19c45298361d75f744dcda295fa635a8490c3c
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.co=
m>
committer: St=C3=A9phane Wirtel <stephane at wirtel.be>
date: 2019-09-12T09:19:12+01:00
summary:

Doc: Update pickle.rst (GH-14128) (GH-16014)

* Edits for readability and grammar
(cherry picked from commit 362f5350eb5e2c7bfb0b0a8c306a2e128c3aee93)

Co-authored-by: G=C3=A9ry Ogam <gery.ogam at gmail.com>

files:
M Doc/library/pickle.rst

diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
index 9442efa2b667..eb58178e0e92 100644
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -211,8 +211,9 @@ process more convenient:
=20
 .. function:: dump(obj, file, protocol=3DNone, \*, fix_imports=3DTrue, buffe=
r_callback=3DNone)
=20
-   Write a pickled representation of *obj* to the open :term:`file object` *=
file*.
-   This is equivalent to ``Pickler(file, protocol).dump(obj)``.
+   Write the pickled representation of the object *obj* to the open
+   :term:`file object` *file*.  This is equivalent to
+   ``Pickler(file, protocol).dump(obj)``.
=20
    Arguments *file*, *protocol*, *fix_imports* and *buffer_callback* have
    the same meaning as in the :class:`Pickler` constructor.
@@ -222,7 +223,7 @@ process more convenient:
=20
 .. function:: dumps(obj, protocol=3DNone, \*, fix_imports=3DTrue, buffer_cal=
lback=3DNone)
=20
-   Return the pickled representation of the object as a :class:`bytes` objec=
t,
+   Return the pickled representation of the object *obj* as a :class:`bytes`=
 object,
    instead of writing it to a file.
=20
    Arguments *protocol*, *fix_imports* and *buffer_callback* have the same
@@ -233,13 +234,13 @@ process more convenient:
=20
 .. function:: load(file, \*, fix_imports=3DTrue, encoding=3D"ASCII", errors=
=3D"strict", buffers=3DNone)
=20
-   Read a pickled object representation from the open :term:`file object`
+   Read the pickled representation of an object from the open :term:`file ob=
ject`
    *file* and return the reconstituted object hierarchy specified therein.
    This is equivalent to ``Unpickler(file).load()``.
=20
    The protocol version of the pickle is detected automatically, so no
-   protocol argument is needed.  Bytes past the pickled object's
-   representation are ignored.
+   protocol argument is needed.  Bytes past the pickled representation
+   of the object are ignored.
=20
    Arguments *file*, *fix_imports*, *encoding*, *errors*, *strict* and *buff=
ers*
    have the same meaning as in the :class:`Unpickler` constructor.
@@ -249,12 +250,12 @@ process more convenient:
=20
 .. function:: loads(bytes_object, \*, fix_imports=3DTrue, encoding=3D"ASCII"=
, errors=3D"strict", buffers=3DNone)
=20
-   Read a pickled object hierarchy from a :class:`bytes` object and return t=
he
-   reconstituted object hierarchy specified therein.
+   Return the reconstituted object hierarchy of the pickled representation
+   *bytes_object* of an object.
=20
    The protocol version of the pickle is detected automatically, so no
-   protocol argument is needed.  Bytes past the pickled object's
-   representation are ignored.
+   protocol argument is needed.  Bytes past the pickled representation
+   of the object are ignored.
=20
    Arguments *file*, *fix_imports*, *encoding*, *errors*, *strict* and *buff=
ers*
    have the same meaning as in the :class:`Unpickler` constructor.
@@ -325,7 +326,7 @@ The :mod:`pickle` module exports three classes, :class:`P=
ickler`,
=20
    .. method:: dump(obj)
=20
-      Write a pickled representation of *obj* to the open file object given =
in
+      Write the pickled representation of *obj* to the open file object give=
n in
       the constructor.
=20
    .. method:: persistent_id(obj)
@@ -426,9 +427,10 @@ The :mod:`pickle` module exports three classes, :class:`=
Pickler`,
=20
    .. method:: load()
=20
-      Read a pickled object representation from the open file object given in
-      the constructor, and return the reconstituted object hierarchy specifi=
ed
-      therein.  Bytes past the pickled object's representation are ignored.
+      Read the pickled representation of an object from the open file object
+      given in the constructor, and return the reconstituted object hierarchy
+      specified therein.  Bytes past the pickled representation of the object
+      are ignored.
=20
    .. method:: persistent_load(pid)
=20
@@ -731,13 +733,13 @@ alphanumeric characters (for protocol 0) [#]_ or just a=
n arbitrary object (for
 any newer protocol).
=20
 The resolution of such persistent IDs is not defined by the :mod:`pickle`
-module; it will delegate this resolution to the user defined methods on the
+module; it will delegate this resolution to the user-defined methods on the
 pickler and unpickler, :meth:`~Pickler.persistent_id` and
 :meth:`~Unpickler.persistent_load` respectively.
=20
-To pickle objects that have an external persistent id, the pickler must have=
 a
+To pickle objects that have an external persistent ID, the pickler must have=
 a
 custom :meth:`~Pickler.persistent_id` method that takes an object as an
-argument and returns either ``None`` or the persistent id for that object.
+argument and returns either ``None`` or the persistent ID for that object.
 When ``None`` is returned, the pickler simply pickles the object as normal.
 When a persistent ID string is returned, the pickler will pickle that object,
 along with a marker so that the unpickler will recognize it as a persistent =
ID.



More information about the Python-checkins mailing list