[3.6] Improve IncrementalEncoder documentation (GH-2746) (GH-3475)

getstate and setstate are instance methods, same as encode and reset.
(cherry picked from commit 30644dee0c)
This commit is contained in:
Miss Islington (bot) 2017-09-10 06:26:42 -07:00 committed by Mariatta
parent f8693229f5
commit 638601ec52

View file

@ -554,16 +554,16 @@ define in order to be compatible with the Python codec registry.
if necessary, to reset the encoder and to get the output.
.. method:: IncrementalEncoder.getstate()
.. method:: getstate()
Return the current state of the encoder which must be an integer. The
implementation should make sure that ``0`` is the most common state. (States
that are more complicated than integers can be converted into an integer by
marshaling/pickling the state and encoding the bytes of the resulting string
into an integer).
implementation should make sure that ``0`` is the most common
state. (States that are more complicated than integers can be converted
into an integer by marshaling/pickling the state and encoding the bytes
of the resulting string into an integer).
.. method:: IncrementalEncoder.setstate(state)
.. method:: setstate(state)
Set the state of the encoder to *state*. *state* must be an encoder state
returned by :meth:`getstate`.