Kaydet (Commit) 30644dee authored tarafından Zhiming Wang's avatar Zhiming Wang Kaydeden (comit) Mariatta

Improve IncrementalEncoder documentation (GH-2746)

getstate and setstate are instance methods, same as encode and reset.
üst c0c29dff
...@@ -554,19 +554,19 @@ define in order to be compatible with the Python codec registry. ...@@ -554,19 +554,19 @@ define in order to be compatible with the Python codec registry.
if necessary, to reset the encoder and to get the output. 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 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 implementation should make sure that ``0`` is the most common
that are more complicated than integers can be converted into an integer by state. (States that are more complicated than integers can be converted
marshaling/pickling the state and encoding the bytes of the resulting string into an integer by marshaling/pickling the state and encoding the bytes
into an integer). 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 Set the state of the encoder to *state*. *state* must be an encoder state
returned by :meth:`getstate`. returned by :meth:`getstate`.
.. _incremental-decoder-objects: .. _incremental-decoder-objects:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment