Skip to content

Commit 2de069e

Browse files
pierreglaserpitrou
authored andcommitted
CLN style
1 parent 7df2751 commit 2de069e

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Diff for: Doc/library/pickle.rst

+14-12
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ The :mod:`pickle` module exports two classes, :class:`Pickler` and
374374
can optionally return ``NotImplemented`` to fallback on
375375
:attr:`dispatch_table`-registered reducers to pickle ``obj``.
376376

377-
For a detailed example on how to use :meth:`~Pickler.reducer_override`, see:
378-
:ref:`reducer_override`.
377+
For a detailed example on how to use :meth:`~Pickler.reducer_override`,
378+
see: :ref:`reducer_override`.
379379

380380
.. versionadded:: 3.8
381381

@@ -743,21 +743,23 @@ share the same dispatch table. The equivalent code using the
743743
Subclassing the ``Pickler`` class
744744
---------------------------------
745745

746-
For most use-cases, it is recommended to simply use the :attr:`~Pickler.dispatch_table` of a
747-
:class:`Pickler` instance to customize its behavior, as explained above.
746+
For most use-cases, it is recommended to simply use the
747+
:attr:`~Pickler.dispatch_table` of a :class:`Pickler` instance to customize its
748+
behavior, as explained above.
748749

749-
However, using the :attr:`~Pickler.dispatch_table` may not be flexible enough. In particular
750-
we may want to customize the pickling logic based on another criterion than the
751-
object's type, or we may want to customize the pickling of functions and
752-
classes.
750+
However, using the :attr:`~Pickler.dispatch_table` may not be flexible enough.
751+
In particular we may want to customize the pickling logic based on another
752+
criterion than the object's type, or we may want to customize the pickling of
753+
functions and classes.
753754

754755
For those cases, it is possible to subclass from the :class:`Pickler` class and
755-
implement a :meth:`~Pickler.reducer_override` method. This method can return an arbitrary
756-
reduction tuple (see :meth:`__reduce__`). It can alternatively return
756+
implement a :meth:`~Pickler.reducer_override` method. This method can return an
757+
arbitrary reduction tuple (see :meth:`__reduce__`). It can alternatively return
757758
``NotImplemented`` to fallback to the traditional behavior.
758759

759-
If both the :attr:`~Pickler.dispatch_table` and :meth:`~Pickler.reducer_override` are defined, then
760-
the :meth:`~Pickler.reducer_override` method takes priority.
760+
If both the :attr:`~Pickler.dispatch_table` and
761+
:meth:`~Pickler.reducer_override` are defined, then the
762+
:meth:`~Pickler.reducer_override` method takes priority.
761763

762764
.. Note::
763765
For performance reasons, the C implementation of pickle does not allow to

0 commit comments

Comments
 (0)